Pending Orders Run Twice
-
Greetings, I just landed on fxdreema and applied some rule which is:
if there is 1 running trade and 0 pending orders, then modify TP and next open 3 pending orders in grid + 1 pending orders

on trial, I got 8 total pending orders with last 4 pending orders no TP set up
Those last 4 pending orders shouldn't be created, just open first 4 pending ordershere is my blocks (it located ontrade)

what action should I add to prevent duplicated pending orders?
-
@acealert said in Pending Orders Run Twice:
Greetings, I just landed on fxdreema and applied some rule which is:
if there is 1 running trade and 0 pending orders, then modify TP and next open 3 pending orders in grid + 1 pending orders

on trial, I got 8 total pending orders with last 4 pending orders no TP set up
Those last 4 pending orders shouldn't be created, just open first 4 pending ordershere is my blocks (it located ontrade)

what action should I add to prevent duplicated pending orders?
Okay, now I'm able to prevent pending orders create twice by using "trade created" block, but now TP for pending orders are empty (need to be same as running trade)

The blocks are (ontrade)


So, any hint how to set TP correctly then?
-
@acealert Can you please share the link to the project? That will be easier to check the issue?
-
@l-andorrà please have a look https://fxdreema.com/shared/59UwKErZc
-
@acealert I'm afraid I do not understand what that custom code does but if I understand the strategy correctly, there should be one only open buy and no pending orders for a new buy to be open? On the other hand, I don't see any of the structures of the previous screenshots in the project. Is it the complet project or just a part of it?
-
@l-andorrà
The rule are:
open manually buy/sell at market order
then EA will:
set TP for that market order
create limit orders with TP same as running trade that opened manuallybut right now, EA failed to set TP for all limit orders
yes, these are part of project, I'm not sure to open source publicly. But I can assure you no logics which been deleted affecting the bug (I re-test it, and still produce same bug, cannot set TP for limit orders)
-
@acealert But then how are the first TP distamces calculated? If you open a trade manually, will it have SL and TP? Are those TP and SL levels then used for the new open prices for the pending orders? And how are those level supposed to be calculated then? I'm afraid I'm missing something.
-
@l-andorrà when I enter market order, EA will set TP for my manual order fix by pips. For example 79.000 market order buy, EA will set TP at 79.300 (fix 30 pip)
then for limit orders, they would have to read those 79.300 as TPI'm not using SL
The EA able to do that at first, but they create double limit orders. One with TP as expected , one with no TP (see 1st post and 1st picture)
But after I add "trade created" block, limit orders with TP were gone but not with the one (no TP)
-
@acealert Ok. Then you can do this on the 'on init' tab:
https://fxdreema.com/shared/lrxbUG02d
That will open the first buy (you can add a sell there if necessary). Then both TP and SL price levels will be stored so that you will be able to use them as ope price for any future pending order.
-
@l-andorrà Alright, I'll try on open market tomorrow. It shouldn't open buy automatically when attach on chart right? First open trade should open manually by me
-
@acealert Exactly.