DislikedHey Guys, i want to learn and improve my MQL4 skills. I think the best way to do this is to practice. Unfortunately sometimes I don`t have any nice idea which i can implement in a Expert Advisor / Indicator. So if any of you is interested, please post in this forum your ideas and i will try to implement it into mql4. AndiIgnored
- I will order at TF H4
- First I will look for entry points.
If SMA5> SMA10> SMA50 => I will order with 2 orders at the same time
+ Order 1 (No1): OrderType 1 == Buy; OrderPrice1 == Ask; SL1 = 40 pips; TP1 = 20 pips; Orderlots1 = 1.
+ Second order (No2): OrderType2 == OP_SELLSTOP; OrderPrice2 == OrderPrice1- (SL / 2) * point; SL2 = OrderPrice1 + TP * point (OrderStopLoss2 = OrderTakeProfit1); TP2 = OrderPrice1-SL * point (OrderStopLoss1 = OrderTakeProfit2); Orderlots2 = 3.
- If No1 reaches TP1 but No has OrderType2 == OP_SELLSTOP (No2 is still in the form of pending order, has not been started as a market order) => Delete No2
- If No2 changed from pending order to market order, then immediately place No3.
+ OrderType3 == OP_BUYSTOP;
+ OrderPrice3 == OrderPrice1;
+ SL3 = OrderPrice1-SL * point (OrderStopLoss1 = OrderStopLoss3);
+ TP3 = OrderPrice1 + TP * point (OrderTakeProfit1 = OrderTakeProfit3)
+ Orderlots3 = 6.
At this point I am having a problem that before that I set the conditions to order on 1 candle to avoid ticking on multiple orders at the same time. When No2 turns into market order but H4 candlestick hasn't finished yet, this candle is No1 order candle so No3 should not be placed.
- If No2 reaches TP but No3 remains BUYSTOP => delete No3, close No1.
- If No3 from BUYSTOP changed to BUY, put next order No4
+ OrderType4 == OP_SELLSTOP;
+ OrderPrice4 == OrderPrice2;
+ SL4 = OrderStopLoss2 = OrderStopLoss4
+ TP4 = OrderTakeProfit2 = OrderTakeProfit4
+ Orderlots4 = 12.
Can you help me with this problem?
Thank you very much!