Reply

Order Close/Open this Bar

2 replies

Pago

Customer, bbp_participant, community, 83 replies.

Visit profile

11 years ago #111176

Hello,

 

to me it seems as if the function ‘Order Close (Open) this bar’ returns also the value of pending orders.

How can i get only the value of a real order opening (closing) and not of pending orders?

 

 

Cezar

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

11 years ago #121710

Hi Cezar,

 

you are right, it counts also pending orders.

To make it behave differently you can do it by using a custom function and then define this function in /code/CustomFunctions.mq4

 

The custom function can use the same logic as sqOrderOpenedThisBar()/sqOrderClosedThisBar(), 

but with a check if OrderProfit() > 0 or if OrderType() == OP_BUY || OP_SELL

 

Mark

Mark
StrategyQuant architect

0

Pago

Customer, bbp_participant, community, 83 replies.

Visit profile

11 years ago #121733

Thanks mark, I will test it at the weekend.

0

Viewing 2 replies - 1 through 2 (of 2 total)