I-Kai Wu: I'm trying to make it Close half of my position only once... but it seems to
close multiple times...
You have to have a way to tell if you have already closed it once. I move the SL to BE+ before closing and test that condition.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi...
I'm a newbie just starting out to learn MQL4..
I'm trying using an existing OrderClose function to close half of my trades once my order has traveled in my favor 1x the ATR of the bar before the OrderOpentime(I used a iBarshift function), I've get the code to print out the value I was looking for, and it is correct, however it is not doing the same on the chart.
Also I'm trying to make it Close half of my position only once... but it seems to close multiple times... I tried using a bool set as true at the start of void ontick, turn it as false after partial close and turn it back as true after opening an order, but it doesnt seem to work....
Could anyone help me out? Thank you....