Dukascopy
 
 
Wiki JStore Search Login

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

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

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

IOrder#setOpenPrice changes order properties
 Post subject: IOrder#setOpenPrice changes order properties Post rating: 1   New post Posted: Fri 10 Mar, 2017, 22:19 
User avatar

User rating: 8
Joined: Mon 09 Jun, 2014, 21:07
Posts: 49
Location: Poland, Warsaw
Dear Support,

I would like to report an issue.

Following snippet issues a STOP (LIMIT) order - it is a stop order with 12 pips slippage.

   public void openDummyTrade(IContext context) throws JFException {
      
      Instrument ins = Instrument.EURUSD;
      ITick tick = context.getHistory().getLastTick(Instrument.EURUSD);

      double stopEntryPrice = tick.getBid() + 25.0 * ins.getPipValue();
      double amount = 1.0;
      double slippage = 12.0;
      
      stopEntryPrice = (new BigDecimal(stopEntryPrice)).setScale(ins.getPipScale()+1, BigDecimal.ROUND_HALF_UP).doubleValue();
      
      context.getEngine().submitOrder("STOP" + System.currentTimeMillis(),
            Instrument.EURUSD,
            OrderCommand.BUYSTOP,
            amount,
            stopEntryPrice,
            slippage);   
   }


This is what can be seen in the orders tab:

Image

Now, when I change order's open price using IOrder#setOpenPrice() the order's type changes from STOP (LIMIT) to STOP and information about slippage gets lost. This is what can be seen in the orders tab after the operation.

Image

Please, could you provide a fix in upcoming release?

Thank you & best regards,
Grzegorz


Attachments:
issue_before.png [5.05 KiB]
Downloaded 241 times
issue_after.png [3.97 KiB]
Downloaded 264 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: IOrder#setOpenPrice changes order properties Post rating: 0   New post Posted: Wed 22 Mar, 2017, 17:31 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is is fixed and will be available with the next SDK release this week.


 

Jump to:  

  © 1998-2024 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