Translating from Excel to PRC

Forums ProRealTime English forum ProBuilder support Translating from Excel to PRC

Viewing 8 posts - 1 through 8 (of 8 total)
  • #77061

    Hi!

    Another trader shared an ATR (1) code to use as an intraday indicator that I really want to try out.

    However since I am a beginner at coding and PRC is the first “language” I am learning, I need help translating this from Excel to PRC. I appreciate any help!

    A1 = yesterdays close

    A2 = day high

    A3 = day low

    =IF(A1<A3;A2-A1;IF(A1>A2;A1-A3;A2-A3))

    #77072

    I’m not big on Excel calculations but I think this is what it says. Apologies if I am wrong. If I am then I look forward to being corrected and to learn something!

     

    #77667

    Did you get this to work? When i upload the code i get this result, if you have any tips please let me know!

    Thanks in advance 🙂

     

    #77669

    Don’t add it to your ‘price’ chart – add it as a separate indicator and you get something like this:

    Screenshot_1-2

    What the values or the time frame are supposed to be or how you are supposed to analyse the results I don’t know. Maybe Davham can enlighten us?

     

    #77683

    That’s the formula of the true range,  you could just use TR (keyword I discovered thanks to your question until then I thought the “average true range” over only 1 period was the only way to get it fast) and have the same result:

    If your next question was going to be how to program the average of this over say 14 periods for example, then you can use the averagetruerange keyword:

     

     

    1 user thanked author for this post.
    #77684

    Yes – I guess I should read the question where it clearly says it is the ATR[1] calculation – but as usual I was more interested in the coding problem to solve than the actual question…. and I already knew about the TR instruction! Oh well it is all good practice.

    This code confirms that all three return identical values – so the OP has three ways to choose from:

     

    1 user thanked author for this post.
    #77694

    The trader who shared it with me uses it on an intraday futures chart to take trades. Not sure about the accuracy of it, that is really why I wanted to try it out.

    The code shows the correct value when you add it as an indicator, but is there any way to place it on top of the price like in the example below?

     

    1 user thanked author for this post.
    #77698

    Hello Guys,

    So i have talked to the author of the original code, he is a known swedish daytrader.

    So this code is meant to be built in the chart(see the attachment).

    Blue line = OMX30 Intraday

    Grey line = ATR1 Daily (resolution) high & low

    Yellow = (ATR1 daily high-low)/2+ATR1 daily low.

    So when we spoke he mentioned that you must combine the daily chart ATR1 with intraday chart to make this possible.

    I hope i have all the information needed for you guys to look further if it is possible to code this in PRT.

    If you have questions i can contact the author because i would really love to see this work in PRT too!

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

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