Hello All-
It would be great if someone can give me an idea what I am not understanding here.
I am working on a rather complicated signal that has about 11 data streams. The first 3 are resolutions of 1 sec, 60 seconds, and 3 minutes, all on the same stock.
I have noticed on other signals in the past that on reserve words like BarsSinceEntry and BarsSince Exit the bar time frame appeared to not be correct. I assumed that the bars resolution would be the resolution of the data stream in question.
In this case I used the Extremes function on data1 (1 second resolution). I wanted to look back at 30 minutes, so (30 min x 60 sec/min = 1800) I set my code line to Extremes(Pricedata1, 1800, 1, oExtremeVal, oExtremeBar). The results didn't make sense, so I copied the signal into an indicator and plotted it. The 1800 bars are about 2 hours and 20 minute in the plot. That works out to about 4.67 seconds per bar instead of 1 second per bar.
I haven't rerun the signal yet, But I am guessing that if I use 385 instead of 1800 my results will be closer to what I expect.
Can anyone make sense of this? Thanks
Bar Resolution Time Frame Mismatch? [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Bar Resolution Time Frame Mismatch?
Thank You.
I can't believe I have not picked up on this programming detail until now. My bar time frame issue was the tip of the iceberg.
I think this will probably explain numerous signal results that didn't make sense. I was specifying the data series in the inputs. I had not seen this clearly spelled out anywhere before.
I went through all my code and added the data series to my variables and equations in the format as TJ referenced:
Var: Macd2( 0, data2 );
Macd2 = MACD( close, FastLength, SlowLength ) data2 ;
It radically changed the backtest results. It obviously changed many calculations. I will now have to re-optimize all the settings. Interesting that it is possible to optimize and get decent results off incorrect calculations. It will be interesting to see what this looks like after it is optimized.
Thanks again.
I can't believe I have not picked up on this programming detail until now. My bar time frame issue was the tip of the iceberg.
I think this will probably explain numerous signal results that didn't make sense. I was specifying the data series in the inputs. I had not seen this clearly spelled out anywhere before.
I went through all my code and added the data series to my variables and equations in the format as TJ referenced:
Var: Macd2( 0, data2 );
Macd2 = MACD( close, FastLength, SlowLength ) data2 ;
It radically changed the backtest results. It obviously changed many calculations. I will now have to re-optimize all the settings. Interesting that it is possible to optimize and get decent results off incorrect calculations. It will be interesting to see what this looks like after it is optimized.
Thanks again.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Bar Resolution Time Frame Mismatch?
This is specified in all the manuals.Thank You.
I can't believe I have not picked up on this programming detail until now. My bar time frame issue was the tip of the iceberg.
I think this will probably explain numerous signal results that didn't make sense. I was specifying the data series in the inputs.
I had not seen this clearly spelled out anywhere before.
See post #4I went through all my code and added the data series to my variables and equations in the format as TJ referenced:
Var: Macd2( 0, data2 );
Macd2 = MACD( close, FastLength, SlowLength ) data2 ;
It radically changed the backtest results. It obviously changed many calculations. I will now have to re-optimize all the settings. Interesting that it is possible to optimize and get decent results off incorrect calculations. It will be interesting to see what this looks like after it is optimized.
Thanks again.
(4) [FAQ] Multiple time frame, Multi-Data Analysis
viewtopic.php?f=16&t=6929
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times