Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I can't believe i am asking this question, but can anyone please tell me what Tradestation is doing here? I am going to show a very simple example rather than my code.
Why does an strategy have different values than an indicator is they use the exact same code? For example, plot the monthly SPY with 2 exponential moving averages (10 & 20).
Here is the indicator and screen capture of the print log:
And here is the strategy with orders removed for brevity:
Why does the print log show different values for the fast and slow MA's. Yes, before you ask, both are set at 10 & 20?
The strategy values are obviously wrong and throwing off backtesting any strategy.
Alright, let me have it. What foolish mistake am I making?
Thanks in advance. Also, why does Tradestation show a moving average before enough time has elapsed to develop (18 month moving average before 18 data bars)?
Can you help answer these questions from other members on NexusFi?
Change the inputs to variables and see if that fixes it. Tradestation does not reset inputs on rebuilds. The other consideration is Exponential Average uses all historical data. The strategy has a MaxBars setting that it uses to determine the start date.
the difference might be caused by different max bars back settings for the indicator and strategy. Make sure to set both to the same value and check if the values are the same then. Keep in mind that you are using a start point dependent average (exponential) and the values will not match 100% if the start point is different (although over time they will match close enough most likely).
To answer your question of "Also, why does Tradestation show a moving average before enough time has elapsed to develop (18 month moving average before 18 data bars)?", this depends on the study. The exponential average doesn't look at X bars back only, the length sets the alpha value (smoothing) and it can theoretically be plotted from the first bar on.