I'm currently writing a script that trades a 15 min. bar but uses a 5 min. bar as part of the conditional state to go long, short, exit, etc. I have the instrument on a chart with the 5 min bar as "sub chart #1" and a 15 min. as "sub chart #2." Within my script I reference the 5 min. bar as "Data1" and the 15 min as "Data2."
I have these data series referenced in my variables but I suspect I am missing a reference in the following statement
"Buy ( "LE2" ) 2 Contracts Next Bar at Market;"
The reason I say that is the 5 min bar chart (Data1, sub chart #1) is actually populating with my trade signals. But I am desiring it to be on the 15 min bar chart (Data2, sub chart #2).
I also have one more question in regards to the above. Each data series uses Bollinger Bands within the conditional statements.
In the inputs I define the SD up and SD down for the bands but am not sure if I am properly specifying what data series to use in calculating one standard deviation for both Data1 and Data2.
What I currently have written for variables are
var1( 0, data2),
var14( 0, data1),
And then I assign these variables as follows
var1 = StandardDev( BollingerPrice, Length, 1 );
var14 = StandardDev( BollingerPrice, Length, 1);
Thanks for any help anyone can provide.
Using Two Time Frames Within One Script [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Using Two Time Frames Within One Script
Please see post #4 and post #5I'm currently writing a script that trades a 15 min. bar but uses a 5 min. bar as part of the conditional state to go long, short, exit, etc. I have the instrument on a chart with the 5 min bar as "sub chart #1" and a 15 min. as "sub chart #2." Within my script I reference the 5 min. bar as "Data1" and the 15 min as "Data2."
I have these data series referenced in my variables but I suspect I am missing a reference in the following statement
"Buy ( "LE2" ) 2 Contracts Next Bar at Market;"
The reason I say that is the 5 min bar chart (Data1, sub chart #1) is actually populating with my trade signals. But I am desiring it to be on the 15 min bar chart (Data2, sub chart #2).
I also have one more question in regards to the above. Each data series uses Bollinger Bands within the conditional statements.
In the inputs I define the SD up and SD down for the bands but am not sure if I am properly specifying what data series to use in calculating one standard deviation for both Data1 and Data2.
What I currently have written for variables are
var1( 0, data2),
var14( 0, data1),
And then I assign these variables as follows
var1 = StandardDev( BollingerPrice, Length, 1 );
var14 = StandardDev( BollingerPrice, Length, 1);
Thanks for any help anyone can provide.
viewtopic.php?f=16&t=6929
Re: Using Two Time Frames Within One Script
Once again thank you TJ! I may have one more question but so far what you advised worked. I appreciate the help!
Re: Using Two Time Frames Within One Script
My script is still applying signals to Data1, the slower of the two timeframes and NOT Data2 as I want it to. Data1 and Data2 are clearly referenced throughout the script including the additional reference in the function as TJ kindly pointed out.
In reading about EL I understand the default Data1 is based on the instrument that "created" the chart. So in this case I have Sub Chart #1 as the faster timeframe and designate it Data1 in my script (Data2 and Sub Chart #2 is the slower timeframe).
Should I have the slower timeframe (the one I want to signal off) as Data1 and Sub Chart #1 and then the faster as Data2 and Sub Chart #2? I read in this forum that the shorter timeframe should be Data1 though.
Thank You!
In reading about EL I understand the default Data1 is based on the instrument that "created" the chart. So in this case I have Sub Chart #1 as the faster timeframe and designate it Data1 in my script (Data2 and Sub Chart #2 is the slower timeframe).
Should I have the slower timeframe (the one I want to signal off) as Data1 and Sub Chart #1 and then the faster as Data2 and Sub Chart #2? I read in this forum that the shorter timeframe should be Data1 though.
Thank You!
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Using Two Time Frames Within One Script
Please post your codes.My script is still applying signals to Data1, the slower of the two timeframes and NOT Data2 as I want it to. Data1 and Data2 are clearly referenced throughout the script including the additional reference in the function as TJ kindly pointed out.
In reading about EL I understand the default Data1 is based on the instrument that "created" the chart. So in this case I have Sub Chart #1 as the faster timeframe and designate it Data1 in my script (Data2 and Sub Chart #2 is the slower timeframe).
Should I have the slower timeframe (the one I want to signal off) as Data1 and Sub Chart #1 and then the faster as Data2 and Sub Chart #2? I read in this forum that the shorter timeframe should be Data1 though.
Thank You!
Please post a screenshot and write notes on it to point out to the problem you are having.
[FAQ] How to Post Codes
viewtopic.php?f=16&t=11713
Re: Using Two Time Frames Within One Script
I can't share the conditional statements. Is there a specific section I can share within the script?
Re: Using Two Time Frames Within One Script
It appears I can only apply this signal which I wrote to Sub Chart #1 and NOT Sub Chart #2. So that would tell me I need to reference Sub Chart #1 as my slower timeframe and thus Data1 and the faster timeframe as Sub Chart #2 and Data2.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Using Two Time Frames Within One Script
Please readIt appears I can only apply this signal which I wrote to Sub Chart #1 and NOT Sub Chart #2. So that would tell me I need to reference Sub Chart #1 as my slower timeframe and thus Data1 and the faster timeframe as Sub Chart #2 and Data2.
Multi-data strategy... pg. 34
Re: Using Two Time Frames Within One Script [SOLVED]
As a follow up to anyone asking similar questions, you need to make "Data1" the data series you are applying the study to and not necessarily the shorter time series. So in my case I assigned Data1 (sub chart 1) as the longer time series which I am signaling off and therefore by default Data2 (sub chart 2) as the shorter time series. I am now signaling on the proper timeframe. But I do need to confirm that each data series is referenced properly.
Thank you TJ for the assistance and for the most recent info regarding using multiple time frames. It's on my reading for today. I appreciate the help!
Thank you TJ for the assistance and for the most recent info regarding using multiple time frames. It's on my reading for today. I appreciate the help!
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Using Two Time Frames Within One Script
the "pg.34" refers to the link in the discussion of previous post.Multi-data strategy... pg. 34? In the MC.NET User Manual? I can't find it.
Please see post #4
Multi-data strategy... pg. 34
viewtopic.php?f=16&t=6929