Closing more positions simultaneously
parameter error?
OrderSelect(MyOrderTicket0, SELECT_BY_TICKET, MODE_TRADES)
Great day to phy, I sense your beautiful spirit in helping confused people like
me in solving some challenges. I am Ayo, a new trader trying to build the simplest
code that would exit all open trades and pending orders when a percentage of the
starting balance is gained.
Some thing like :Close all pending orders, and open trades if Equity >= 1.001Initial Balance. Please can i find some help with this from any expert programmer? More profits to your accounts.please you can send the code straight to my email: ayoakorede@yahoo. com
Thanks.
Some thing like :Close all pending orders, and open trades if Equity >= 1.001Initial Balance. Please can i find some help with this from any expert programmer? More profits to your accounts.please you can send the code straight to my email: ayoakorede@yahoo. com
Thanks.
Here is a little framework
double balance; double equity; int init(){ balance = AccountBalance(); } int start(){ ... ... equity = AccountEquity(); if(equity >= balance*1.002){ ... code for close all trades... ... verify all trades closed. if not closed handle the error balance = AccountBalance(); // new starting point for future trades } return(0); }
phy:
Phy, you know I haven't tried it out, but I think you are a great man for your
swift response.Here is a little framework
double balance; double equity; int init(){ balance = AccountBalance(); } int start(){ ... ... equity = AccountEquity(); if(equity >= balance*1.002){ ... code for close all trades... ... verify all trades closed. if not closed handle the error balance = AccountBalance(); // new starting point for future trades } return(0); }
Best Regards Ayo
61177:
phy:
Phy, I tried compiling it, but it didn't work! Is there a way I should go about
it? Pls tell me in full because i am not a programmer Here is a little framework
double balance; double equity; int init(){ balance = AccountBalance(); } int start(){ ... ... equity = AccountEquity(); if(equity >= balance*1.002){ ... code for close all trades... ... verify all trades closed. if not closed handle the error balance = AccountBalance(); // new starting point for future trades } return(0); }
The above is "pseudocode", meaning, enough to give you an idea, but not meant to run "as is"
https://en.wikipedia.org/wiki/Pseudocode
If you are not a programmer, consider becoming one.
61177:
61177:
phy:
Thanks Phy, but i would appreciate if you could just write the complete code for
me. if i start learning programming now, it is would take a life time b4 i understand
the syntax..., talkless of writing a correct code.cheersHere is a little framework
double balance; double equity; int init(){ balance = AccountBalance(); } int start(){ ... ... equity = AccountEquity(); if(equity >= balance*1.002){ ... code for close all trades... ... verify all trades closed. if not closed handle the error balance = AccountBalance(); // new starting point for future trades } return(0); }
There are examples of "close all trades" in previous posts.
phy:
Phy, please could you just do me a favor of completing the good work you started
by assisting me to write the complete code. I went through all i ones i saw but
they were too complex for me to use and besides, they are meant to met different
needs . The pseudocode you gave is absolutely similar to what i need.
There are examples of "close all trades" in previous posts.
I'd like to close 3 open positions with the following code, but it closes just the first position. How can I close all of them?
My wrong code:
Thanks for helping!