Grid placing to many trades.
-
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

-
Light pink need a dark pink for each block first, put your once per bar under blocks that check for something, if position will look for running trades, not pending orders, maybe add another light pink "once per position"
-
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.
-

-
What do you all think of this order?
-

I am attempting to place a buy order at the first take profit Then close pending orders if it hits the take profit.
-
Above the pending order does not get placed. I changed it and now I get too many pending orders.

-
I think I solved the pending orders situation. But now the pending order won't delete if it hits the stop loss.

-
Nope. Not solved yet. Please help.
-
For each position I'd like 1 buy pending order at the take profit of the initial market order. Once they hit their tp sl the pending orders should be closed.
-
So it should go buy market. Hit tp of market order then Buy a pending order.
Or Buy market order and place buy pending order at the TP of the market order like I did here.

-
But it does this.

-
I know what was happening. The no position does not count pending orders. I tried this but similar thing happens.

-
it's better to add a shared link rather than pictures, no trade(position)/order will work for both a running trade and pending order. On the on trade tab you will have purple blocks, when something happens like a trade opens you can delete pending orders
-
Thank you for that. How do I share a link?
-
https://fxdreema.com/shared/lh8TX9zZd
Found it.
-
Change no position to position/order.

-

Like this?
-
I think it would be like this.
-
https://fxdreema.com/shared/EDrpSORjc I think it is working now even. The orders still have to be cancelled still.