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
ProOrder’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.
Hi Kaq,
Roberto is right. If you want an entry signal to last for 3 candles you can do something like that:
ENTRYSIGNAL = CONDITION1 AND CONDITION2 AND CONDITION3...
IF ENTRYSIGNAL OR ENTRYSIGNAL[1] OR ENTRYSIGNAL[2] THEN
BUY AT MARKET
ENDIF
Thanks 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?
I think is posible, just change the MARKET order for “BUY AT CLOSE+2 STOP”
There you go (not tested);
Bullish = close > open
Body = 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 c4
c = 0
If c5 Then
c = close
Endif
If summation [3](c5) Then
Buy 1 Contract at c + 2 Stop
Set Target pProfit 10
Set Stop pLoss 10
Endif
You are right, line 13 should read:
Buy 1 Contract at c + 2*pipsize Stop