- This EA is not working as per my strategy. Need your help to modify the same.
- Coding help
- [ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3.
I want to modify above mentioned code in such a way that it opens BUY and SELL order first then Once Take Profit is hit it again open BUY and SELL order with same quantity again and again
OrderSelect(i, SELECT_BY_POS,MODE_HISTORY); OrderSend (sym, OP_BUY, lot, Ask,...
What are Function return values ? How do I use them ? - MQL4 forumif(OrderClosePrice() == OrderTakeProfit())
A SL/TP becomes a market order. The close price will never be equal. Working with Doubles in MQL4 - MQL4 Articlesif(TimeCurrent() - OrderCloseTime()==1)
What happens if there is no tick in the second the previous order closed?OrderSelect(i, SELECT_BY_POS,MODE_HISTORY); if(OrderSymbol() == Symbol())
No magic number makes the EA incompatable with ever other (including itself on other TFs) and manual trading.
Dear RaptorUK,
When I run this EA on live trade. I have to put first Buy and Sell order manually. EA put Buy order only once Profit taking hit. Some time it puts 2-3 Buy order simultaneously. It should put one Sell order along with one Buy order. And if it can be modified in a way that first manual order of Buy and Sell should not be put then it would be of great help. I have been using these strategy since one year and it has been profitable for me.
Thank you very much in advance for your help.
Thanks
Manoj
Dear RaptorUK,
When I run this EA on live trade. I have to put first Buy and Sell order manually. EA put Buy order only once Profit taking hit. Some time it puts 2-3 Buy order simultaneously. It should put one Sell order along with one Buy order. And if it can be modified in a way that first manual order of Buy and Sell should not be put then it would be of great help. I have been using these strategy since one year and it has been profitable for me.
total = OrdersHistoryTotal(); for(i = total - 1; i >= 0; i--) { OrderSelect(i, SELECT_BY_POS,MODE_HISTORY); if(OrderSymbol() == Symbol()) { if(TimeCurrent() - OrderCloseTime()==1) { if(OrderClosePrice() == OrderTakeProfit()) OrderSend (sym, OP_BUY, lot, Ask, 3, 0,Ask+take_profit*Point, "buy!!!", magic, 0, Blue); OrderSend (sym, OP_SELL, lot, Bid, 3, 0,Bid-take_profit*Point, "sell !!!", magic, 0, Red); } }} return(0);RaptorUK:
I'm sure it can be modified . . . but you haven't explained what part of the coding you are having problems with ?
If condition to identify the last order close can be made accurate and order send is not triggering both order. Is it not possible to modify coding as per strategy I have mentioned above using MQ4 language?
If condition to identify the last order close can be made accurate and order send is not triggering both order. Is it not possible to modify coding as per strategy I have mentioned above using MQ4 language?
I am looking forward to receive any feedback soon!
I am looking forward to receive any feedback soon!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use