Download MetaTrader 5
To add comments, please log in or register
How to test a program before buying?
Kourosh
23
Kourosh 2011.02.16 14:24 

All of EA's that I have worked with open ie. long position and when condition changes close the open position and goes for short position right a way. There is always another condition that EA should close all the open positions and simply do NOTHING. Can you guide me how can I add this capability to my codes?

Ubzen
Moderator
5394
Ubzen 2011.02.16 15:17  
Stop using stop & reverse logic. You can tell it to Buy when X=true/1 and Sell when X=false/-1. Personally, I like to use integers instead of Bool for my Trigger. You can also do things like set the Trigger to 0 when closing orders.
/
To add comments, please log in or register