Hi everyone.
Time is a crucial condition of my strategy and PRT doesn’t allow for time based order cancellations. Because I must wait for an actual candle to close before an order is deleted, this forces me to trade from a lower timeframe than what I normally would and aggregate the candles. E.g. I would normally trade a M5 timeframe, but in order to cancel an order e.g. after 2 minutes, I can’t wait for a M5 candle to close. That’s 5 minutes. So I must trade M1 candles based on my M5 setups, mark up the high and low of five period M1 candles which is then equal to the high and low of the M5 candle.
Now I’m able to stop an order from repeating after 2 minutes, but my question is if it’s possible to place orders at e.g. high of a candle with a different timeframe than from the timeframe the algo is running on?
I have read about multi timeframe support, but this still remains unclear to me.
Thanks in advance
Yes you can do what you want, below is an example, courtesy of JS from the link
MULTITIMEFRAME AUTOMATIC TRADING
DefParam CumulateOrders=False
TimeFrame(5 minutes, UpDateOnClose)
Zenith=High+4*pipsize
TimeFrame(Default) //TF 10 seconds
If Close>=Zenith then
Buy 1 contract at Market
EndIf
If OnMarket and BarIndex-TradeIndex>=30 then
Sell at Market
EndIf
GraphOnPrice Zenith