Forums › ProRealTime English forum › ProOrder support › First try to code a strategy › Reply To: First try to code a strategy
04/14/2019 at 8:23 PM
#96429
I saw that there is a built-in indicator called ‘change’ that displays the percentage variation between the close and yesterdays close. When I use the simplified creation in PRT and click the ‘change’ indicator window the code uses a function called variable. Out of curiosity and for learning purposes I was wondering how I can use this in my code instead of your first suggestion:
1 2 |
closepercentage = abs((close - close[1])/close) bearsetup2 = summation[4](closepercentage <= closepercentage[1]) = 4 |
Lets say I want that the percentagechange today should be equal to the highest percenagechange in 2 days. Measured close to close.
Is it possible to write this using the ‘variation’ function?