PureBytes Links
Trading Reference Links
|
I’am looking for some help to figure out the following issue with TS Pro (or with my understanding of the process in TS Pro) . This issue seems to be related to the way TS Pro handles Series Functions/Variables on multidata Chart. Here is a code to demonstrate the issue:
{*****Sample Indictor to demonstrate that Value2<>Value3 on Multi-Data Chart in TradeStation Pro}
Value1=Close;
Value2=AverageFC(Value1, 10);
Value3=Average(Value1, 10);
Plot1(Value2);
Plot2(Value3);
{*********************************************************************************}
If this indicator is applied to 1min chart for TRAD, it shows that Value2=Value3. Now, if INTC added to the TRAD chart as Data2, Value2 and Value3 no longer are equal with noticeable difference (not a precision issue for 10 bar length).
After some research I found that the difference between Value1 and Value2 will accumulate during the periods, where Data1 has missing bars while Data2 has valid bars. It seems that AverageFC in TS Pro recalculate itself with any valid bar (it does not matter where the bar came from: Data1 or Data2) and assumes that it is a new bar for Data1. So
AverageFC will deduct Price of [10] bar and add Price of the Current missing Bar even though there were no bar for Data1. This will make AverageFC to “forget” all prices of the 10 past valid bars and instead calculate average of 10 pseudo new equal bars which actually never existed and when new “valid” bar for Data1 arrives AverageFC will post the
new Average result which has nothing to do with the Average of the last 10 bars of Data1).
If word “Close” used directly as a parameter of AverageFC instead of Value1, the difference between Value2 and Value3 disappears. Or if I use Value1[1] instead of Value1 no difference also. When I try to use “dummy” statement to force Value1 to become Series variable, the difference stays.
When tested on real time data more strange behavior has been observed. I will post it if it would be confirmed that it is really some issue in TS Pro, not in my head.
Thanks,
gary
|