EA not taking trades
-
I built this test EA, and for some reason it is not taking trades. I have read through the forums and watched the videos, but for the life of me cannot understand what is wrong. This is the logic: It should open a trade if the condition exists and no other trades are open. Now, lets say a BUY trade is open. If it meets the conditions for a sell trade, it should close the Buy trade and open a Sell trade. Same for the opposite. Also, I want to include the indicator arrows, but not every time because it will draw consecutive buys and sells. I want them to only draw one buy arrow. The next arrow should be a sell. I did read at this link Arrow Variable that it is possible to use a variable to only allow the arrow to draw if it is the first one, but don't understant the variable part. Link to Project
-
It doesn't work because you are mixing the opening conditions with the closing conditions in the same block tree. You need to separate them completely. Your opening tree should end with a buy/sell now block at the bottom. No more blocks below.
Then your closing tree should be headed by a 'For each trade' block and ended by a 'close trades' at the bottom. No more blocks below.
-
Thank you for the input. I will make the modifications when I get time.