How to identify Order closed by Stop Loss?

 

I need to write MLQ4 code in which I would like to know how I can count the number of closed Order by Stop Loss.

If it closed by OrderClose() command it is possible to identify closed order but if it closed by Stop Loss not sure how would I know that Order is closed by SL?

I would appreciate if someone can through light on this.

Thanks

Ash

 
netFX:

I need to write MLQ4 code in which I would like to know how I can count the number of closed Order by Stop Loss.

If it closed by OrderClose() command it is possible to identify closed order but if it closed by Stop Loss not sure how would I know that Order is closed by SL?

I would appreciate if someone can through light on this.

Thanks

Ash

Hi netFX,

OrderClosePrice() == OrderStopLoss()

Click those links please.

:D

 
onewithzachy:

Hi netFX,

OrderClosePrice() == OrderStopLoss()

Click those links please.

:D


Thanks! I hope this will work.
 

When the market reaches the SL price, it becomes a market order. The Order Close price will NEVER be EXACTLY equal to the SL. If the market gaps, the close price may be hundreds of pips beyond the SL price.

if (OrderSelect(..., MODE_HISTORY){
    if (OrderType() == OP_BUY) bool ClosedBySL = OrderClosePrice() <= OrderStopLoss();
    else                            ClosedBySL = OrderClosePrice() >= OrderStopLoss();
}
 
WHRoeder:

When the market reaches the SL price, it becomes a market order. The Order Close price will NEVER be EXACTLY equal to the SL. If the market gaps, the close price may be hundreds of pips beyond the SL price.

Hi WHRoeder,

In other words, broker server is unable to close client position when price is way over SL. If that ever happen, complain the broker, coz they just cheat us. I wonder what processor they use, is it Intel 4004 ?

Broker server should close our position EXACTLY to our SL, not a point more not a point less !.

Now that you brought that up, it's good idea to check them up - including the TP - did they close less than our TP ?.

:D

 
onewithzachy:


Broker server should close our position EXACTLY to our SL, not a point more not a point less !.

Only if they offer guaranteed stops.
 
RaptorUK:
Only if they offer guaranteed stops.

Hi RaptorUK,

Seriously ?!?.

Must they offer that first ? On legal paper ?. And I suppose they stop us less than our TP too ?

We can do this :

 if (price == SL) close_client_position

, and their server - their accounting server - can't ?

Those thing never happen to me. All I know about those kind of broker - pip hunting broker - is non regulated broker, forexpeacearmy have lots of story of 'em.

I don't buy it if my regulated brokers do that, of course, I have to write them now, just to make sure - lol.

Anyway - like I said to WHRoeder, if that happen - complain the broker, my det stat said that I have 24 hours to complain, I'm full aware that computer - including broker server - may have glitches.

Funny way to scare me, RaptorUK.

:D

 
onewithzachy:

Hi RaptorUK,

Seriously ?!?.

Yes . . .

Do you offer guaranteed stop losses?

No, we do not offer guaranteed stop losses.

From a Broker whose name begins with A

 
RaptorUK:

Yes . . .

Do you offer guaranteed stop losses?

No, we do not offer guaranteed stop losses.

From a Broker whose name begins with A

Hi RaptorUK,

Ala ... rip ? :), Yay ! Check later by email, browser crashes when open chat :(

:D

Where were you on Friday ? Silverstone ?

 
onewithzachy:


Where were you on Friday ? Silverstone ?

Yup . . . in the rain, and then in the Carpark for over 3 hours.

Got a few pictures . . . Mark Webber

 
RaptorUK:

Yup . . . in the rain, and then in the Carpark for over 3 hours.

Got a few pictures . . . Mark Webber

O wow, RaptorUK, lucky you ! :) Did you take all those pics on website ?.

Damn, I didn't know there's Sachsenring, wanted to see how Stoner fell :).

Haven't yet contact my brokers, though.

:D

Reason: