Cancel order after three candles
Forums › ProRealTime English forum › ProOrder support › Cancel order after three candles
- This topic has 7 replies, 4 voices, and was last updated 3 years ago by robertogozzi.
-
-
09/15/2020 at 3:46 PM #144359
Hi folks, looking for code for second step of below logic, if someone could help please:
- Place a stop order (BUY amount LOT AT 25 stop)
- If order is not filled in next three candles or within next 45 minutes, cancel this stop order
Thanks in advance, kaq
09/15/2020 at 5:13 PM #144362ProOrder’s logic is the other way round.
Pending orders ALWAYS expire each bar, so you need to place them again each new bar if your entry conditions are still valid.
When conditions are no more valid, just don’t place them.
09/15/2020 at 8:01 PM #144374Hi Kaq,
Roberto is right. If you want an entry signal to last for 3 candles you can do something like that:
12345ENTRYSIGNAL = CONDITION1 AND CONDITION2 AND CONDITION3...IF ENTRYSIGNAL OR ENTRYSIGNAL[1] OR ENTRYSIGNAL[2] THENBUY AT MARKETENDIF09/15/2020 at 8:24 PM #144375Thanks both.
My strategy is, if current candle closes bullish engulfing, place a pending stop order two points above the closing candle, and wait for next three candles to see if order gets fulfilled else cancel pending order.
Reading what has been explained above, looks like it is not possible…or is it?
09/15/2020 at 8:31 PM #144376I think is posible, just change the MARKET order for “BUY AT CLOSE+2 STOP”
09/15/2020 at 9:12 PM #144380There you go (not tested);
12345678910111213141516Bullish = close > openBody = abs(close - open)c1 = close >= open[1]c2 = open <= close[1]c3 = Body > Body[1]c4 = Bullish AND Bearish[1]c5 = c1 and c2 and c3 and c4c = 0If c5 Thenc = closeEndifIf summation [3](c5) ThenBuy 1 Contract at c + 2 StopSet Target pProfit 10Set Stop pLoss 10Endif1 user thanked author for this post.
09/16/2020 at 7:46 PM #14447109/16/2020 at 8:20 PM #144476You are right, line 13 should read:
1Buy 1 Contract at c + 2*pipsize Stop -
AuthorPosts
Find exclusive trading pro-tools on