MICHParticipant
Junior
Ciao a tutti,
Sono in difficoltà a inserire un codice che apra una posizione con una condizione che è verificata su un time frame diverso da quello sul quale sto operando. Ad esempio buy se:
- RSI(14) > 30 nel time frame 5 min (che è il time frame nel quale sto scrivendo il codice)
- ADX (14) > 20 sul time frame 30 min
Mi potete per favore aiutare?
JSParticipant
Senior
Hi,
Try this one:
DefParam CumulateOrders=False
TimeFrame(30 minutes, UpdateOnClose)
xADX=ADX[14]
TimeFrame(Default) //5 minutes
xRSI=RSI[14]
If xADX>20 and xRSI>30 then
Buy 1 contract at Market
EndIf
Graph xADX
Graph xRSI