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.

Historical tester - why transactions canceled?
 Post subject: Historical tester - why transactions canceled? Post rating: 0   New post Posted: Thu 21 Jan, 2010, 15:38 

User rating: 0
Joined: Fri 15 Jan, 2010, 13:58
Posts: 8
Hi,
I'm testing some strategy with jforex historical tester. The problem is with some of orders the strategy tries to fill but they are being canceled "because of no liquidity". I understand what it means, but I'm not convinced it is a true reason.

Example:
2010-01-07 22:18:38 Order submitted Order [M1x1rqgiv3hf, EUR/USD, BUY, 100000.0 at 1.43065] submitted by the strategy
2010-01-07 22:18:38 Order filled Order [M1x1rqgiv3hf, EUR/USD, BUY, 100000.0 at 1.43065] filled
2010-01-07 22:18:38 Order submitted Order [M1x12djqla6t, EUR/GBP, SELL, 100000.0 at 1.43045] submitted by the strategy
2010-01-07 22:18:38 Order canceled Order [M1x12djqla6t, EUR/GBP, SELL, 100000.0 at 1.43045] canceled because of no liquidity at the price

As you can see a strategy tried to submit an order on 2010-01-07 22:18:38, opening only 0.1 lot, EUR/GBP. I don't believe at that time the market depth was so small that it couldn't be possible to open a 0.1 l position. This is not a standalone example, I'm getting such errors in strategy report for other pairs as well, i.e. usd/chf, eur/chf.

Can you please determine why does it happen and how to avoid these errors?


 
 Post subject: Re: Historical tester - why transactions canceled? Post rating: 0   New post Posted: Thu 21 Jan, 2010, 16:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You are trying to open EUR/GBP sell with price 1.43045. Bid price of EUR/GBP at that moment was 0.89925 which is a lot less than the price you requested. It looks you are trying to use price of EUR/USD or some other pair on the wrong instrument.
FYI, tester doesn't check liquidity, it will sell you 100 millions even if there was only 1 million at the market. It only checks that the price you request does hit into the market price.


 
 Post subject: Re: Historical tester - why transactions canceled? Post rating: 0   New post Posted: Thu 21 Jan, 2010, 16:20 

User rating: 0
Joined: Fri 15 Jan, 2010, 13:58
Posts: 8
You pointed me out how to fix my code. The problem was with:

intTicket=OrderSend(Instrument.fromString("EUR/GBP"),OP_SELL,dblPositionSize,Bid,50,0*Point,0*Point,"",1,0,Red);

The strategy is running on EUR/USD chart but it can open EUR/GBP position as well. So in this case variable "Bid" means a price of EUR/USD, not EUR/GBP.
That's why I was trying to open EUR/GBP using a EUR/USD price :)

Thank you.


 

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