Help Error when Open Trade after certain price movement
-
Hi' guys,
The concept of this EA that i want to develop is pretty simple. It gonna mimic Renko chart but I'm not gonna use Renko chart in here.
So, this EA gonna open trade every "x" price movement. I have an input called "movementSet" to determine how much movement that the price should travel before opening a new trade.
For example,
Trading on EURUSD i gonna put "0.001" on "movementSet" input, then every 0.001 price increase from the last trade, it will open a new BUY trade. Also every 0.001 drops from the last trade it'll open a new SELL trade.
At on Start i immediately put 2 trade, one BUY and one SELL for become the anchor point to calculate the price movement.
But the problem is, it opens trade every single bar. Even when i change the input to 50, it still opens trade every single bar.
Here's the project https://fxdreema.com/shared/2tURg427dAny comment will be so appreciated
Thanks in advance -
The solutions is not trivial. Essentially, you should duplicate all the structure you have right now on the 'on Tick' tab into the 'on Trade tab. Then You should substitute that 'Once per bar' block on top by a 'No trade' one.
The structire on the 'on Tick' tab would open the dirst tardes and would check if prices are hit or not. The structure on the 'on Trade' tab should be the one opening all trades after the first one. Certainly a complex structure, but effectivem though.
-
HI @l-andorrà , thanks for your reply
So what you want to say is COPY all block from onTick to onTrade? Doesn't it going to be redundant? -
Yes, copy them but then, as I said, modify thr one 'on tick' to open the first trade only and then those on the 'on trade' tab will open all the following trades.