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.

Order.getOpenPrice() returns 0 ?!
 Post subject: Order.getOpenPrice() returns 0 ?! Post rating: 0   New post Posted: Wed 08 Sep, 2010, 13:57 

User rating: -
the state of the order that I am asking for its OpenPrice is = "CREATED"
but the problem is that returned value is = zero
and this causes many problems in my strategy tester

I'm using OnTick function call and don't filter bars to avoid week-ends and flat bars ...

Any idea?!


 
 Post subject: Re: Order.getOpenPrice() returns 0 ?! Post rating: 0   New post Posted: Thu 09 Sep, 2010, 08:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
The order has no information about it's open price before it's opened. The open price from an order you can have only after it's state had been changed to OPENED. So, solution is to check the orders state before it's call OpenPrice.


 
 Post subject: Re: Order.getOpenPrice() returns 0 ?! Post rating: 0   New post Posted: Thu 09 Sep, 2010, 12:43 

User rating: -
Hi all,

now I add the state test of order while asking for the OpenPrice and I'am surprised by the fact that it takes a lot time to get a response (many bars of hours) .

what do think of this?!


 
 Post subject: Re: Order.getOpenPrice() returns 0 ?! Post rating: 0   New post Posted: Fri 10 Sep, 2010, 16:13 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
If you create a buy market order, then the order open price after submit will be zero, and after order fill open will be changed. Please take a look at the following JForex Wiki page https://www.dukascopy.com/wiki/index.php ... rder_State.


 

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