Customized Trading session

Forums ProRealTime English forum ProOrder support Customized Trading session

Viewing 12 posts - 1 through 12 (of 12 total)
  • #99319

    Hi everyone,

    I am new to prorealcode.

    I have an strategy which trades on price levels using previous trading session’s open, high, low, close. The CFD market may trade 24hrs a day, yet i would only use price information between 0915-0100 (1 complete session)to calculate my price levels.

    I wonder if there is anyway on coding that could help me automatically store the values using the concept of “previous session”and tackle the issues during weekend(price level on monday would be based on Friday’s OHLC)

     

    #99320

    U can alter the time-data in “Platform options”..

    #99324

    I am sorry. is the coding charts based? which means if I display 0915-0100 on the chart then my orders would only be able to execute during 0915-0100?

    If so the next question are there any keywords/ functions (e.g.similar to dhigh[0]) for me to store previous 0915-0100 session’s OHLC.

    Many thanks!

    #99330

    Do you want this as an indicator or as part of a auto strategy?

    I have moved your topic to the ProOrder forum which is for auto-trading questions. You posted in the General Trading Discussion forum which is not the right place for these sort of questions. Please try to post in the correct forum with future topics. 🙂

    #99335

    It is a part of the auto-trading.

    I am sorry for any inconvenience caused.

    #99348

    You can do something like:

    Not tested.

    Use lastop, lastcl, lasthi and lastlo in your code to get the open, close, high and low for the previous session.

    make sure the chart you use has candles that represent any time that you choose. So you need a 15 minute chart or faster to see 0915.

    #99405

    Thanks for your idea.

    However, when a new trading day begins (i.e. 0915), lastop, lasthi, lastlo, lastcl would be replaced by new OHLC of the new trading day.

    Let’s say the market run from 0915-0100 the next day, from  monday to  saturday, and let’s call monday 0915-tuesday 0100 as day1, …., until friday 0915 – saturday 0100 as day 5.

    What I want to do is:

    day2 would trade on OHLC of day1

    day3 would trade on OHLC of day2

    day4 would trade on OHLC of day3

    day5 would trade on OHLC of day4

    day1 would trade on OHLC of previous day5

    in this case I need a set of functions to read OHLC of the previous “day”.

     

     

    #99406

    Which is exactly what the code I wrote should do. At the endtime it stores the sessions OHLC as lastop, lastcl, lasthi, lastlo whereas op, cl, hi and lo are the current sessions OHLC.

    It needs just a small modification to be certain that it avoids any Sunday data but if your start time does not exist on a Sunday chart then it will ignore them any way.

    I’ve not tested it but I can’t see any reason why it would not be doing what you want.

     

    #99680

    I finally had a chance to test it and there was a minor error. This code does what you asked for:

    Remove the ‘buy at -close stop’ when you adapt it for your strategy as that code is just for testing to prove the values are correct.

     

    1 user thanked author for this post.
    #99686

    hi 

    Thanks a lot for your effort. I will definitely try it out.

    However I want to catpure the price movement (OHLC) from 915am to 1am the next day . On this regard , line 17 would not function as time could not be larger than 091500 and smaller than 010000 at the same time . Any solution to it ?

    Many thanks !

    #99688

    Replace AND with OR.

    1 user thanked author for this post.
    #99736

    It works well. Thanks a lot for your help.

Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login