Hi
I am developing a new indicator : averageTrueRange on the BarsOfData(2)
(see the attached example average_True_Range_BarsOfData2.pln)
but if I compare it, to the regular indicator averageTrueRange.
(if I put the regular indicator averageTrueRange manualy on barOfData 2)
I get a different results , see Capture.jpg attached.
The other indicator don't give this error.
Do you know why I have this difference with averageTrueRange?
Thank you
Emmanuel
averageTrueRange not working correctly with BarsOfData2 [SOLVED]
averageTrueRange not working correctly with BarsOfData2
- Attachments
-
- Capture.JPG
- (192.83 KiB) Downloaded 855 times
-
- average_True_Range_BarsOfData2.pln
- (1.25 KiB) Downloaded 765 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: averageTrueRange not working correctly with BarsOfData2 [SOLVED]
Hello Emmanuel,
Our engineer has corrected the study for you. Please find working code attached.
Our engineer has corrected the study for you. Please find working code attached.
- Attachments
-
- average_True_Range_BarsOfData2_fix.pln
- (1.25 KiB) Downloaded 675 times
Re: averageTrueRange not working correctly with BarsOfData2
Hello Henry
Thank you very much for your solution !!!! Thank you to the engineer team too !!!
It works !!!
I give the #datastream in sub create and sub calcbar and it work !!
I didn't know that we could write in the calcbar:
2/ Do you know what for is 0 in this.AverageTrueRange above ? (int bb ?)
1/ Does it mean that we can change of datastream in Calcbar ? Or does it have to be the same as in create ?
3/ Do you know , how many datastream we can have in one graphic ?
Best Regards to all your team !!!
Emmanuel
Thank you very much for your solution !!!! Thank you to the engineer team too !!!
It works !!!
I give the #datastream in sub create and sub calcbar and it work !!
I didn't know that we could write in the calcbar:
Code: Select all
m_atr.Value = this.AverageTrueRange(atrlength, 0, IndexMemoireBarsOfData);
2/ Do you know what for is 0 in this.AverageTrueRange above ? (int bb ?)
1/ Does it mean that we can change of datastream in Calcbar ? Or does it have to be the same as in create ?
Code: Select all
m_atr = new VariableSeries<Double>(this, IndexMemoireBarsOfData);
Best Regards to all your team !!!
Emmanuel
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: averageTrueRange not working correctly with BarsOfData2
Yes, you can change it, but you should keep in mind that it cannot be changed on a fly for a series variable.1/ Does it mean that we can change of datastream in Calcbar ? Or does it have to be the same as in create ?Code: Select all
m_atr = new VariableSeries<Double>(this, IndexMemoireBarsOfData);
bb - BarsBack - amount of bars for initial calculation. More info here.2/ Do you know what for is 0 in this.AverageTrueRange above ? (int bb ?)
Up to 100.3/ Do you know , how many datastream we can have in one graphic ?