Close on reverse
-
Hi
I want my EA to close the position on reverse condition, and open a a new inverse position at the same time i.e if it's long, close buy and at the same time, sell.
Anyone can help me?
Thanks
-
The idea is to have 2 block chains under "on Tick" like this:
No buys => Check condition to open new Buy => Close all trades (or only sells, but there are no buys anyway) => Create new Buy
No sells => Check condition to open new Sell => Close all trades (or only buys, but there are no sells anyway) => Create new SellDepending on the condition "Once per bar" can be used somewhere to speed up the backtesting (actually not checking conditions when there is no need to) or to limit the number of trades in one bar in case you got both conditions within a very short period of time.