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.

Discrepancies betw Indicator & Strategy inputs except Close
 Post subject: Discrepancies betw Indicator & Strategy inputs except Close Post rating: 0   New post Posted: Wed 06 Apr, 2011, 18:26 

User rating: 0
Joined: Sun 30 Jan, 2011, 11:43
Posts: 6
Hello Support,

I created a trivial indicator called COPY, that copies indicator's Input data to the Output (Open, Close, High, Low, Volume).
When I compare this indicator's output to the caller strategy's BID bar OCHLV, I observe the following:

Period=15min : all of them are equal to bidBar.getClose().
Period=10secs:
Indicator's Close is "often" equal to strategy's Close (bidBar.getClose()) - no longer systematic
Discrepancies appear amongst the other indicator's input, and they are still different from their equivalent in the strategy.

Note that the indicator's graph is correct, so there seem to be a pb with the transfer of the indicator's output back to the strategy (or with my code ...). The pb is the same whether the input type is PRICE or BAR (the attached code supports both).

Attached the code for you to reproduce.
Please advise,
Thanks.
---------
Attachment:
TPStrategy.java [6.69 KiB]
Downloaded 309 times

Attachment:
Copy.java [6.33 KiB]
Downloaded 323 times


 
 Post subject: Re: Discrepancies betw Indicator & Strategy inputs except Cl Post rating: 0   New post Posted: Wed 06 Apr, 2011, 21:51 

User rating: 0
Joined: Sun 30 Jan, 2011, 11:43
Posts: 6
Problem apparently solved indicator results offsets:

use: return new IndicatorResult(0, endIndex-startIndex);

Kind of beginner error I guess. :mrgreen:


 

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