Hi
Is it possible to have a higher timeframe moving average like the 4hr which then determines the value of a variable “Startime”
Then use “Startime” in your lower timeframe like 5min.
It gives me a parsing error when I then call the indicator function into my trading strategy.
Timeframe(4hour,updateonclose)
If Close<exponentialaverage[20]*0.985 Then
Startime=090000
else
Startime=101500
endif
Timeframe(Default,updateonclose)
If Time > Startime and Time < 133000 Then
If Openhour > 9 and Close/Close[190]-1 > 1.25/100 Then
TradeLong=0
else
TradeLong=1
Endif
If Openhour > 9 and Close/Close[190]-1 < -0.9/100 Then
TradeShort=0
else
TradeShort=1
Endif
Endif
If the ‘call’ed indicator has the timeframe command in it, I think that causes the parse error.
Its best to write the code directly in the strategy file, this avoids the longer execution times with the calling process.
However, it can work if the TIMEFRAME command is in the strategy file and the call is from the timeframe block, but it will be longer to execute.
Also the indicator file has to be suitably set up as a general indicator which works with any timeframe its put on.
Keeping the execution time down , helps when back-testing.