How to use info from daily chart into my 1min system?

Forums ProRealTime English forum ProOrder support How to use info from daily chart into my 1min system?

Viewing 6 posts - 1 through 6 (of 6 total)
  • #82920

    Hi guys,

    Hoping you can help me here…

    I am building a very simple strategy for market open spikes. The theory of the system is VERY basic, but putting it into code form is not so basic!

    Basically, I want to get in if the price spikes over X% of the 5 day ATR in either direction, and the take profit would be the same X% of the 5 day ATR.

    Stop would be a break of the opening 1 min candle.

     

    Now there are 2 problems here…

    1. The 5 day ATR is pulled from the daily chart, so how do I get this info into my 1 min system?
    2. The daily charts with my broker (IG) run from midnight to midnight, but I only want the ATR value to be from cash hours only (08:00 – 16:30 UK time). So how do I get round this? Would I have to create a custom indicator to ONLY take into account cash hours, when calculating the 5 day ATR?

     

    I could always just input the 5 day ATR manually before running the system, but this would not be of any use for back testing.

     

    Any help is greatly appreciated guys.

    Thanks

    #82938

    For question 1 you need MTF which is in beta testing at the moment but can be used live upon request. Plenty of info on it here:

    https://www.prorealcode.com/blog/learning/approach-multi-timeframe-trading-prorealtime/

    For question 2 – yes you would need to write a custom indicator that uses market prices only during your required times and then calculates the ATR from these values. With MTF this code could be included in your strategy rather than calling a separate indicator.

    #83074

    so how do i go about creating a code to give the 5 day ATR from cash hours only?

    Sorry, Im a total noob

     

    Thanks

    #83083

    As far as I am aware the calculation for ATR[5] is:

    Current ATR = [(Prior ATR x 4) + Current TR] / 5

    Multiply the previous 5-day ATR by 4.

    Add the most recent day’s TR value.

    Divide the total by 5

    So you would need to store the values at your chosen start and finish times for the last five start and finish times to get your starting values to calculate ATR. Then at each new update of the values you would need to forget the oldest set and add the newest set by using something like:

    I’m a bit too busy at the moment to write the full code – maybe someone else could help if they have the time.

     

    #83141

    Thanks for that, but to be honest, it kind I can’t really do anything with that haha, as I don’t know how to put it into code. How do you guys learn?! There are zero training courses on this. 🙁

     

    Thanks

    #83145

    I kind of just picked it up but then I did used to mess around with programming about 30 years ago!

    Try here to start on your learning path:

    https://www.prorealcode.com/programming-with-prorealtime/

    …or just create codes with the PRT tool and spend a lot of time hanging around on these forums and you will learn a lot.

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

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