Bar Resolution Time Frame Mismatch?  [SOLVED]

Questions about MultiCharts and user contributed studies.
wismc848
Posts: 6
Joined: 02 Nov 2015
Has thanked: 2 times
Been thanked: 1 time

Bar Resolution Time Frame Mismatch?  [SOLVED]

Postby wismc848 » 16 Jun 2016

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

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Bar Resolution Time Frame Mismatch?

Postby TJ » 16 Jun 2016

See post #5
(5) [FAQ] Data2
viewtopic.php?f=16&t=6929

wismc848
Posts: 6
Joined: 02 Nov 2015
Has thanked: 2 times
Been thanked: 1 time

Re: Bar Resolution Time Frame Mismatch?

Postby wismc848 » 16 Jun 2016

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.

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Bar Resolution Time Frame Mismatch?

Postby TJ » 17 Jun 2016

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.
This is specified in all the manuals.

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.
See post #4
(4) [FAQ] Multiple time frame, Multi-Data Analysis
viewtopic.php?f=16&t=6929

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Bar Resolution Time Frame Mismatch?

Postby TJ » 17 Jun 2016

See post 1 & 2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713


Return to “MultiCharts”