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.

T3 values in history wrong (?)
 Post subject: T3 values in history wrong (?) Post rating: 0   New post Posted: Wed 12 Dec, 2012, 14:10 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
Hello!

I am not quite sure whether the mistake is on my side but the value from the chart is different from that one I gain from the onStop method.

I call a method with this:

(contained by onStop)

...
long creationTime = o.getCreationTime();
...
if (o.isLong()) console.getOut().print((getT3Long(creationTime)[2] - getT3Long(history.getPreviousBarStart(t3AuxiliaryPeriod2, creationTime))[2]) + ";");
...

My method:

public double[] getT3Long(long time) {
double[] t3 = {-1};
double[] t3a = {-1};
double[] t3a2 = {-1};
double[] result = {-1, -1, -1};

try {
long barTime = history.getBarStart(t3Period, time);
t3 = indicators.t3(currency, t3Period, OfferSide.ASK, t3AppliedPrice, t3TimePeriod, t3vFactor, barTime, barTime);

//Auxiliary period
long barTimeA = history.getBarStart(t3AuxiliaryPeriod, time);
t3a = indicators.t3(currency, t3AuxiliaryPeriod, OfferSide.ASK, t3AppliedPrice, t3TimePeriod, t3vFactor, barTimeA, barTimeA);

//Auxiliary period 2
long barTimeA2 = history.getBarStart(t3AuxiliaryPeriod2, time);
t3a2 = indicators.t3(currency, t3AuxiliaryPeriod2, OfferSide.ASK, t3AppliedPrice, t3TimePeriod, t3vFactor, barTimeA2, barTimeA2);

result[0] = t3[0];
result[1] = t3a[0];
result[2] = t3a2[0];
} catch (Exception e) {
console.getErr().println("T3 long: " + e.getMessage());
}

return result;
} //End of method getT3Long


I use the indicator and the chart correctly but there are different values displayed.

Is it a bug within the backtest function or is my source code wrong?

Thanks and regards!


 
 Post subject: Re: T3 values in history wrong (?) Post rating: 0   New post Posted: Wed 12 Dec, 2012, 14:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please go through the following list:
https://www.dukascopy.com/wiki/#Indicator_usage_checklist


 
 Post subject: Re: T3 values in history wrong (?) Post rating: 0   New post Posted: Wed 12 Dec, 2012, 15:25 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
That's it!

It was the filter but interestingly enough, the values of the charts were right but the daily chart values.

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