Dear Tito
Seeing your code would help since what u are saying is not really logical, i mean its like this if(something happens u want){open trade} then u just modify the the IF(....) to your need, but if u put your code here then i can help ya better!
the code is not doing something u didnt wrote so :D
hope it helps, if not then i await for your code
Onarius
Thanks for your tip Onarius.
As you asked, follow the code:
void OnTick() { //--- if(PointA()>0 && PointA()<PointB() && PointA()>PointC()) { if(UseRevTrade==false && Count(0)==0) OpenOrder(0); if(UseRevTrade==true && Count(1)==0) OpenOrder(1); } if(PointA()>0 && PointA()>PointB() && PointA()<PointC()) { if(UseRevTrade==false && Count(1)==0) OpenOrder(1); if(UseRevTrade==true && Count(0)==0) OpenOrder(0); }
Supposes that buy rule is achieved "if(PointA()>0 && PointA()<PointB() && PointA()>PointC())" ok? And let's supposes that the price hit my TP. When the prices hit my TP the Long position is closed. However, if the buy rule is configured yet, another buy position will be open immediately.
I don't wanna this. I wanna open another buy position if another buy or sell signal is configured.
Thanks again bro.
- When you post code please use the CODE button (Alt-S)!
(For large amounts of code, attach it.)
Please edit
your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - Your code is if(condition) open. That will open an order every tick. Are you checking for previously open orders?
- You are looking at a signal. Act on a change of signal.
MQL4 (in Strategy Tester) - double testing of entry conditions - Strategy Tester - Expert Advisors and Automated Trading - MQL5 programming forum
- When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - Your code is if(condition) open. That will open an order every tick. Are you checking for previously open orders?
- You are looking at a signal. Act on a change of signal.
MQL4 (in Strategy Tester) - double testing of entry conditions - Strategy Tester - Expert Advisors and Automated Trading - MQL5 programming forum
Thanks for the advice. About question 2, i'm not checking for previously open orders.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Guys,
How can I coding an EA so that it trades only 1 times and once that trade is close? i.e take profit is hit then don't trade again until the next rule signal...let me explain it in detail....If the trade has hit its TP then wait for other buy or sell signal. If another signal is not achieved, do not place any further trades...but at the moment my EA achieved another signal, opens another trade...
Thanks
Tito.