Hello,
I’m having trouble writing a code with conditions from 2 TF.
- Weekly rsi[9] crosses under 30
and then wait for:
2. Daily rsi[14] crosses under 20.
Is that possible?
There you go:
timeframe(Weekly,UpdateOnClose)
Wrsi = rsi[9]
c1 = Wrsi crosses under 30
Timeframe(Daily,UpdateOnClose)
Drsi = rsi[14]
c2 = Drsi crosses under 20
Timeframe(Default)
Cond = c1 AND c2
IF Cond THEN
buy at market
set stop ploss 200
set target pprofit 400
ENDIF
At lines 1 and 4 you can replace UpdateOnClose with Default, not to wait the closing of the candle before updating variables.