I DL'd the jtHMA function and study from:
viewtopic.php?f=5&t=4479&hilit=jthma
They both compile and run fine, but the beginning of the study plot always starts far below the price chart points so my strategies all start out with a wacky trade. Would some brave soul take a look at the code and see if you can determine why it does this? I am attaching a shot of jtHMA and a 14-day EMA on the same CL chart. Note the difference with the EMA; that's how I want jtHMA to behave also.
Thanks,
Geoff
jtHMA Plot Wrong at Beginning of Series
jtHMA Plot Wrong at Beginning of Series
- Attachments
-
- jtHMA vs EMA example.jpg
- (442.41 KiB) Downloaded 404 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: jtHMA Plot Wrong at Beginning of Series
The jtHMA function needs more data on the chart to make a proper calculation.I DL'd the jtHMA function and study from:
viewtopic.php?f=5&t=4479&hilit=jthma
They both compile and run fine, but the beginning of the study plot always starts far below the price chart points so my strategies all start out with a wacky trade. Would some brave soul take a look at the code and see if you can determine why it does this? I am attaching a shot of jtHMA and a 14-day EMA on the same CL chart. Note the difference with the EMA; that's how I want jtHMA to behave also.
Thanks,
Geoff
Re: jtHMA Plot Wrong at Beginning of Series
Is there some way I can alter the function to simply start plotting when it has sufficient data, like the EMA study does?
I backed the Data Range to mid-November 2014 so the HMA would be correctly calculated for 1/1/15 onwards. However, the strategy starts when the data starts so I still get a bad trade at the beginning. Short of hard-coding a start date into the strategy, is there some way to fix the function so it behaves like all the other ones? I'm not yet proficient enough in EasyLanguage to solve this myself.
Thanks,
Geoff
I backed the Data Range to mid-November 2014 so the HMA would be correctly calculated for 1/1/15 onwards. However, the strategy starts when the data starts so I still get a bad trade at the beginning. Short of hard-coding a start date into the strategy, is there some way to fix the function so it behaves like all the other ones? I'm not yet proficient enough in EasyLanguage to solve this myself.
Thanks,
Geoff
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times