Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

setStopLoss OfferSide
 Post subject: setStopLoss OfferSide Post rating: 0   New post Posted: Thu 06 Feb, 2014, 18:08 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
In IEngine.submit, there is no option to influence
the OfferSide used in the StopLoss. The default
is usually ok.

But in IOrder.setStopLoss we are able to select
the stop OfferSide. Whether the SL is triggered
on the Bid side or on the Ask side.

This means that if we want to take the "non default"
OfferSide for a StopLoss, we can't specify it in
IEngine.submit, but have to specify it later in
IOrder.setStopLoss using the OfferSide argument.

Is this correct? It would be nice of the StopLoss
OfferSide could be specified in IEngine.submit .

HyperScalper


 
 Post subject: Re: setStopLoss OfferSide Post rating: 0   New post Posted: Fri 14 Feb, 2014, 10:16 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
hyperscalper wrote:
Is this correct? It would be nice of the StopLoss
OfferSide could be specified in IEngine.submit .
Yes it is correct, but we don't plan to add additional IEngine.submit overloading method for the sake of this.


 
 Post subject: Re: setStopLoss OfferSide Post rating: 0   New post Posted: Tue 18 Feb, 2014, 17:35 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
OK, that's fine, no need for the overload.


EDIT CORRECTION: Mea Culpa, I had a bug in my code, so there
is no bug in the stop loss offer side behavior. THANKS !

Stop Loss offer side works correctly.

Take the case of a LONG position, the standard Stop Loss side will
be the BID. This is to ensure that the Market SELL will be as close
as possible to the precise stop loss desired. So we see the condition
in the JForex platform shown as BID<=<stopprice>

When I replace the existing stop loss for a LONG order, and use
the OfferSide ASK we should see the condition displayed
in the orders table as ASK<=<stopprice>. Isn't this what I should
expect to see?

I have a task which checks all Stop Losses, and determines their
OfferSide. If this does not match the desired side, then the
Stop Loss is replaced using the desired OfferSide as follows:

IOrder.setStopLossPrice(double price, OfferSide side)

I HAD A BUG IN MY CODE.

HyperScalper


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com