No free help 2017.04.21
Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum 2018.05.12
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help 2017.04.21
You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
No free help 2017.04.21
Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum 2018.05.12
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help 2017.04.21
This is what i tried to do, i tried to make the EA open a new trade each time the stop loss is above the previous open price:
This is what i tried to do, i tried to make the EA open a new trade each time the stop loss is above the previous open price:
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
Ok thank you. Post updated.
- You are selecting by ticket. No where do you check if the order is still open.
- StopLoss is a variable. It is not the order's SL.
This is what I did although it is still not working:
I selected the previous order and checked to see if the price (Close[1]) has moved a certain distance (Pyramid) in my favour before opening a new order:
Pls what is wrong with the code?
if(ABuyTicket > 0) { OrderSelect(ABuyTicket,SELECT_BY_TICKET); OpenPrice = OrderOpenPrice(); double StopPrice = OrderStopLoss(); //Open 2nd Buy Order if(((OpenPrice + (Pyramid * PipPoint(Symbol()))) < Close[1]) && (Close[1] > AHigh) && (equity > balance) && (BuyMarketCount(Symbol(),MagicNumber) < 2)) { BBuyTicket = OpenBuyOrder(Symbol(),LotSize,UseSlippage,MagicNumber); //2nd Buy Order Modification if(BBuyTicket > 0 && (StopLoss > 0 || TakeProfit > 0)) { OrderSelect(BBuyTicket,SELECT_BY_TICKET); OpenPrice = OrderOpenPrice(); //Calculate and Verify Stop Loss (and Take Profit) BuyStopLoss = CalcBuyStopLoss(Symbol(),StopLoss,OpenPrice); if(BuyStopLoss > 0) BuyStopLoss = AdjustBelowStopLevel(Symbol(),BuyStopLoss,5); BuyTakeProfit = CalcBuyTakeProfit(Symbol(),TakeProfit,OpenPrice); if(BuyTakeProfit > 0) BuyTakeProfit = AdjustAboveStopLevel(Symbol(),BuyTakeProfit,5); //Add Stop Loss (and Take Profit) AddStopProfit(BBuyTicket,BuyStopLoss,BuyTakeProfit); } } }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Good day guys,
I am trying to code an EA that opens a new trade as soon as the trailing stop for the previous entry is at breakeven. I want to do this at least 5 times when the trailing stop is above the previous entry price.
Thank you.