Hi Alfofxsolution,
I use a Martingale EA that trades with a number of baskets of trades. Can your EA be attached to mine and have it close a particular basket of trades, instead of closing all the other baskets of trades. And also close at an Equity Stop level of that particular basket.
Regards
Jimbos181
Hi Jimbos181,
It depend on how do you marked individual baskets of trades. If it can be selected by magic number or symbol, then yes. Close at an Equity Stop level not. By the way, consider if is martingale good approach. Do you want to spend months or years with not perspective idea? You will waste your time on it. But, just my opinion.
This code is of very poor quality.
Never use it on a real account as you are risking very bad surprise.
This code is of very poor quality.
Never use it on a real account as you are risking very bad surprise.
Hi Alain, what do you exactly mean? Because we use Close at Time for months without any fails. Two different brokers, live and demo account too. Thanks for your comments
My previous message was not very constructive, should not post so late ;-)
It all depends on the context...but sooner or later someone will have problems.
The main issue is you ALWAYS need to count down when processing orders :
for(int i=OrdersTotal()-1; i>=0; i--)
.And when you try 3 times in a row to close, you need to refresh your price :
if(OrderClose(OrderTicket(),OrderLots(),AskOrBid,MaxSlippage)==false) { // Your AskOrBid could be obsolete : need RefreshRates() ... //Retries 2// if(OrderClose(OrderTicket(),OrderLots(),AskOrBid,MaxSlippage)==false) { // Your AskOrBid could be obsolete : need RefreshRates() ... //Retries 3// if(OrderClose(OrderTicket(),OrderLots(),AskOrBid,MaxSlippage)==false) { error=GetLastError(); Print("Error closing order for ticket:"+StringConcatenate(OrderTicket())+" Error: "+StringConcatenate(error)+" : "+ErrorDescription(error)); } } }You don't process errors you just report it and retry. Believe my on a live trading environment that could lead to problems. Other points are minor.
My previous message was not very constructive, should not post so late ;-)
It all depends on the context...but sooner or later someone will have problems.
The main issue is you ALWAYS need to count down when processing orders :
.And when you try 3 times in a row to close, you need to refresh your price :
You don't process errors you just report it and retry. Believe my on a live trading environment that could lead to problems. Other points are minor.Thank you Alain, good point. It could lead in problems in some specific situations. New version is waiting for approve.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Close At Time:
Close At Time is an EA that closes open positions or deletes pending orders or both. You can also specify how it should be closed – by symbol, magic number or ticket number.
Author: Algofxsolution