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.

Equivalent Stop order for BUYSTOP_BYBID
 Post subject: Equivalent Stop order for BUYSTOP_BYBID Post rating: 0   New post Posted: Sun 13 Oct, 2013, 06:31 

User rating: 0
Joined: Wed 18 Sep, 2013, 23:54
Posts: 4
I've now implemented a BUYSTOP_BYBID order into my strategy which is brilliant, works perfectly for new long orders. However, as I use a stop and reverse strategy I'd like to know the equivalent for the stop loss order for the Short side? The SL and new Long order are created when a crossover between a slow and fast MA occurs. When the order is short it currently sets a SL at
askBar.getHigh() + dist*pv
and the new long order uses BUYSTOP_BYBID and is set at
bidBar.getHigh() + dist*pv
. Is there an equivalent for the SL so that it triggers a close order when the bid price =
bidBar.getHigh() + dist*pv
? Otherwise it is exiting the short order at a different level to the new long order.


 
 Post subject: Re: Equivalent Stop order for BUYSTOP_BYBID Post rating: 0   New post Posted: Sun 13 Oct, 2013, 21:16 

User rating: 0
Joined: Wed 18 Sep, 2013, 23:54
Posts: 4
Worked it out. Just use
order.setStopLossPrice(Price, OfferSide.BID);
. Much simpler than I thought!


 

Jump to:  

  © 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