Above the pending order does not get placed. I changed it and now I get too many pending orders.

Above the pending order does not get placed. I changed it and now I get too many pending orders.


I am attempting to place a buy order at the first take profit Then close pending orders if it hits the take profit.
Thank you for that piece of advice. I am checking for other trade and then if it is x amount away from the SL then I need a pending order.
Greetings yall,;
I am working on a grid EA. The EA is making to many trades. I am new to grids. Here is a snippet of code. What do you think about this?
-Michael

I changed my mind on this even. Thank you.
Thank you for your reply. I am thinking about an oscillator based on the HA.
If I used Heiken Ashi would the other indicators be base doff of HA or regular price?

I do not see a for each trade block. Also, I need my account to have a max loss of say $100 not a percent of balance. What can I do?
I have another question. How do I get the trades to close if profit is negative x amount? I used account button profit (equity-balance) > -x but it does not work on the tester.
I am trying to run an EA and I need it to buy/sell real time before the candle closes. I putting candle id to 0. Is there anything else I can do?