Hello All,
I’m trying to write a programme line entry whereby I want to execute a trade if a condition has been fulfilled with the last N periods (for example; if a cross of price over 100 MA line has occurred within X number of time frames). Anyone able to provide guidane on how this condition can be expressed?
Thanks!
There you go:
x = summation[10](condition)
If x Then
.
.
Endif
Awesome, thanks Roberto!!!
Follow up question, do you know how I could make this work with TIMEFRAME? say for instance, I want to check this in a 10min chart and my default where I am running the programme is 5 min (i.e. I want the programme to trade only if condition X has een validated in 10min timeframe).
You can use it as many times as needed, provided you name variabls differently among TF’s:
Timeframe(10 minute,UpdateOnClose)
x10 = summation[10](10-minute-condition)
If x10 Then
.
.
Endif
Timeframe(default)
xD = summation[10](default-TF-condition)
If xD Then //or If xD AND x10 Then
.
.
Endif