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.

LinearReg output some pips above chart
 Post subject: LinearReg output some pips above chart Post rating: 0   New post Posted: Mon 28 Feb, 2011, 10:39 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
i noticed output of double linearReg indicator is some pips above what i see frome chart

L400_0=indicators.linearReg(instrument, selectedPeriod, OfferSide.BID, AppliedPrice.CLOSE, 400,0);
so L400_0 refers to linearReg line of current bar with close price
but the value of L400_0 i printed from message box is about 7pips above itself in chart when line go up
my instrument is eurusd and selectedPeriod is 10 mins
or some pips below when line goes down


can support team tell me why?

by the way what is the output of linearRegAngle,is it in degree or radian?


 
 Post subject: Re: LinearReg output some pips above chart Post rating: 0   New post Posted: Tue 01 Mar, 2011, 10:32 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Please make sure platform flats filter is disabled (Tools/Preferences/Chart/Flats filtration).
The output of linearRegAngle is in degrees (rad*180/Pi).


 
 Post subject: Re: LinearReg output some pips above chart Post rating: 0   New post Posted: Tue 01 Mar, 2011, 11:57 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
Support wrote:
Hi,
Please make sure platform flats filter is disabled (Tools/Preferences/Chart/Flats filtration).
The output of linearRegAngle is in degrees (rad*180/Pi).



yes thanks for your answer,thats the reason ,bu t i want to filter weekends ,and if so i must use double [] method,
but if i write in this way ,the output should be linearReg of current bar
double []L200_0=indicators.linearReg(instrument, selectedPeriod, OfferSide.BID, AppliedPrice.CLOSE, 200,indicatorFilter, 200, currentBar.getTime(), 0);

indicatorFilter is Filter.WEEKEND

in fact the output differs a lot from chart


 
 Post subject: Re: LinearReg output some pips above chart Post rating: 0   New post Posted: Tue 01 Mar, 2011, 14:35 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Please have a look at the overview section of the following JForex Wiki article: https://www.dukascopy.com/wiki/index.php ... Indicators
Also, try the following:
int candlesBefore = 1, candlesAfter = 0;
long time = context.getHistory().getBar(instrument, period, OfferSide.BID, 0).getTime();
double[] value = context.getIndicators().linearReg(instrument, Period.ONE_HOUR, OfferSide.BID, AppliedPrice.CLOSE, 400, Filter.WEEKENDS, candlesBefore, time, candlesAfter);


 

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