Edit Your Comment
CloseAllAtEquityLevel
तबसे मेंबर है Apr 17, 2012
9 पोस्टों
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
May 04, 2012 at 02:46
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
More specifics would help.
By the title, it also sounds more like a trade management EA. Steve Hopwood wrote an excellent Multi Purpose Trade Management EA (MPTM). Read its documentation, it'd probably do what you want.
That said:
extern bool EquityStopLoss = TRUE;
extern double EquityPercent = 10.0; //for 10% drawdown
int start(){
if(EquityStopLoss&&1-AccountEquity()/AccountBalance()>EquityPercent/100){ //if drawdown exceeds 10%
CloseAll(); //Close all trades
}
}
void CloseAll(){ //Close all BUY and SELL orders including Pending Orders if any
bool result=false;
for(int i=OrdersTotal()-1;i>=0;i--){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)result=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),MaxSlippage*mt,Blue);
if(result==false){
Print("CloseAll failed with error#",GetLastError());
continue;
}
}
}
By the title, it also sounds more like a trade management EA. Steve Hopwood wrote an excellent Multi Purpose Trade Management EA (MPTM). Read its documentation, it'd probably do what you want.
That said:
extern bool EquityStopLoss = TRUE;
extern double EquityPercent = 10.0; //for 10% drawdown
int start(){
if(EquityStopLoss&&1-AccountEquity()/AccountBalance()>EquityPercent/100){ //if drawdown exceeds 10%
CloseAll(); //Close all trades
}
}
void CloseAll(){ //Close all BUY and SELL orders including Pending Orders if any
bool result=false;
for(int i=OrdersTotal()-1;i>=0;i--){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)result=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),MaxSlippage*mt,Blue);
if(result==false){
Print("CloseAll failed with error#",GetLastError());
continue;
}
}
}
Consistency above all.
तबसे मेंबर है Apr 17, 2012
9 पोस्टों
May 10, 2012 at 18:37
तबसे मेंबर है Apr 17, 2012
9 पोस्टों
Raiden posted:
More specifics would help.
By the title, it also sounds more like a trade management EA. Steve Hopwood wrote an excellent Multi Purpose Trade Management EA (MPTM). Read its documentation, it'd probably do what you want.
That said:
extern bool EquityStopLoss = TRUE;
extern double EquityPercent = 10.0; //for 10% drawdown
int start(){
if(EquityStopLoss&&1-AccountEquity()/AccountBalance()>EquityPercent/100){ //if drawdown exceeds 10%
CloseAll(); //Close all trades
}
}
void CloseAll(){ //Close all BUY and SELL orders including Pending Orders if any
bool result=false;
for(int i=OrdersTotal()-1;i>=0;i--){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)result=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),MaxSlippage*mt,Blue);
if(result==false){
Print("CloseAll failed with error#",GetLastError());
continue;
}
}
}
Thank you for the answer!
I dont know much about Metaquotes... How can I change the percentage?
If I want that it closes all my operations if the equity reaches 20% decrease... fore example... What Should I do?
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
May 10, 2012 at 18:53
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
I never mentioned Metaquotes.
Google this "Multi Purpose Trade Management EA". Read the 1st entry, it should be from forexfactory.com
... sometimes I can sympathise with Steve.
Google this "Multi Purpose Trade Management EA". Read the 1st entry, it should be from forexfactory.com
... sometimes I can sympathise with Steve.
Consistency above all.
तबसे मेंबर है Apr 17, 2012
9 पोस्टों
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
May 11, 2012 at 02:14
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
You could copy that text, open the Meta Editor, and paste that into an EA. (There are two more variables that need to be defined though.)
But you should skip that and just use the Multi Purpose Trade Management EA by Steve Hopwood in the forexfactory.com link.
But you should skip that and just use the Multi Purpose Trade Management EA by Steve Hopwood in the forexfactory.com link.
Consistency above all.
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
May 13, 2012 at 02:18
(एडिट हो रहा है May 13, 2012 at 02:18)
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
Whoops, I notice my comments in my CloseAll() function says it closes Pending Orders too but it doesn't. I forgot to update it when I separated it out.
Consistency above all.
तबसे मेंबर है Dec 15, 2010
784 पोस्टों
May 26, 2012 at 19:26
तबसे मेंबर है Dec 15, 2010
784 पोस्टों
I have a programmer that could do that money management program change for a fee. Hes very good. Most likely would charge form $35 to $75 would be my guess if the prg isnt private or locked.
Click on my Name to see My Live Charts and Bio.
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
May 31, 2012 at 01:56
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
I've written the EA, you can find it here.
http://raidenworks.com/2012/05/31/drawdown-percent-close-ea/
http://raidenworks.com/2012/05/31/drawdown-percent-close-ea/
Consistency above all.
तबसे मेंबर है May 30, 2012
124 पोस्टों
May 31, 2012 at 06:05
तबसे मेंबर है May 30, 2012
124 पोस्टों
Dude i would program those lines for ar 5 $
This is one or 2 simple for functions till everything is closed
This is one or 2 simple for functions till everything is closed
I am the change in the market that causes you to lose :p / Watch out before I negative pip you! ^^
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
May 31, 2012 at 09:29
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
*Must* suppress urge not to.. feed.. troll....
Consistency above all.
तबसे मेंबर है Dec 15, 2010
784 पोस्टों
Jun 03, 2012 at 07:18
तबसे मेंबर है Dec 15, 2010
784 पोस्टों
There are a number of free EAs that can be added to a extra chart to do what you wish, I had my programmer add that function to my last EA.
Click on my Name to see My Live Charts and Bio.
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
Jun 03, 2012 at 10:45
तबसे मेंबर है Nov 27, 2010
244 पोस्टों
@ Professor53:
Could you point out the links to them? Would be interesting to check them out.
Could you point out the links to them? Would be interesting to check them out.
Consistency above all.
Nov 08, 2016 at 07:25
तबसे मेंबर है Jul 07, 2016
1 पोस्टों
Hi Raiden.
I like your indicator but need update.
Please update your indicator with new MQL4 language. (The MQL4 language has significantly changed since build 600 in the beginning of 2014).
If I cannot update it, the guidelines me to update it. I am a novice in MQL
I like your indicator but need update.
Please update your indicator with new MQL4 language. (The MQL4 language has significantly changed since build 600 in the beginning of 2014).
If I cannot update it, the guidelines me to update it. I am a novice in MQL

*व्यवसायिक इस्तेमाल और स्पैम को ब्रदाश नहीं किया जाएगा, और इसका परिणाम खाता को बन्द करना भी हो सकता है.
टिप: किसी चित्र या यूट्यूब या URL को पोस्ट करने से वे अपने आप आपके पोस्ट में आजाएगा!
टिप: @ चिन्ह को टाइप करें उपभोगता के नाम को अपने आप करने के लिए जो इस चर्चा में भाग ले रहा है.