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.

BUYSTOP_BYBID & SELLSTOP_BYASK
 Post subject: BUYSTOP_BYBID & SELLSTOP_BYASK Post rating: 0   New post Posted: Fri 17 Aug, 2012, 15:33 

User rating: 1
Joined: Thu 23 Feb, 2012, 11:22
Posts: 23
Hi Support,

For the following order where orderCommand = BUYSTOP_BYBID. What will the ordercommand be for the stoplossprice, SELLSTOP_BYASK or SELLSTOP?

submitOrder(String label,
Instrument instrument,
orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice)

Regards

Mark


 
 Post subject: Re: BUYSTOP_BYBID & SELLSTOP_BYASK Post rating: 0   New post Posted: Tue 21 Aug, 2012, 17:37 

User rating: 1
Joined: Thu 23 Feb, 2012, 11:22
Posts: 23
For the following order where orderCommand = BUYSTOP_BYBID.

The ordercommand for the stoplossprice defaults to SELLSTOP?

Is there a way to set the ordercommand for the stoplossprice to SELLSTOP_BYASK?

submitOrder(String label,
Instrument instrument,
orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice)

Regards

Mark


 
 Post subject: Re: BUYSTOP_BYBID & SELLSTOP_BYASK Post rating: 0   New post Posted: Thu 23 Aug, 2012, 14:56 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
you can use IOrder interface method setStopLossPrice(double price, OfferSide side) and set OfferSide.BID.


 
 Post subject: Re: BUYSTOP_BYBID & SELLSTOP_BYASK Post rating: 0   New post Posted: Thu 23 Aug, 2012, 16:17 

User rating: 1
Joined: Thu 23 Feb, 2012, 11:22
Posts: 23
Great.

Is it necessary to wait after submitOrder() before submitting setStopLossPrice(double price, OfferSide side)?

order.waitForUpdate(2000)


 
 Post subject: Re: BUYSTOP_BYBID & SELLSTOP_BYASK Post rating: 0   New post Posted: Mon 27 Aug, 2012, 07:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Only if you right away want to use IOrder.getStopLossPrice. In that case you need to await the server's update on the order.


 

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