NexusFi: Find Your Edge


Home Menu

 





Multiple time frames


Discussion in MultiCharts

Updated
    1. trending_up 2,602 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Multiple time frames

  #1 (permalink)
shamanov
Toronto Canada
 
Posts: 9 since Jan 2018
Thanks Given: 5
Thanks Received: 1

I'm trying to use multiple time frames in my signal; All functions in the signal use the primary time frame but one function uses an secondary time frame on the same symbol. I've set up the secondary time frame in the format instruments but was wondering how to get this one function within the signal to use the secondary time frame. Do I need to set up the secondary time frame in the signal or do I do this in the function code. If so how can I do this. I understand that this code:
BarsOfData(2).Close[0] will utilize second time frame in relation to price but how can I get the function to use BarsOfData(2).

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

shamanov,

you need to tie functions to their respective data streams. This should get you going: https://www.multicharts.com/discussion/viewtopic.php?f=19&t=45848&p=100792&hilit=data2.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
shamanov
Toronto Canada
 
Posts: 9 since Jan 2018
Thanks Given: 5
Thanks Received: 1


I have my second chart hidden using a different time frame but same instrument, and I have a function trying to utilize this second time frame on the hidden chart will this function code utilize the second chart/data stream:

using System;

namespace PowerLanguage.Function
{
public class funciton : FunctionSimple<Double>
{
private sum m_summationfc1;



public funciton(CStudyControl ctx) :
base(ctx) {}

public funciton(StudyControl ctx, int data_stream) :
base(ctx, data_stream) {}

public ISeries<Double> price { get; set; }

public Int32 length { get; set; }


protected override void Create(){
m_summationfc1 = new sum(this);
int data_stream = 2;


}

protected override void StartCalc(){


}


protected override double CalcBar(){
return m_summationfc1[0] / 2;
}
}
}

Reply With Quote
  #4 (permalink)
shamanov
Toronto Canada
 
Posts: 9 since Jan 2018
Thanks Given: 5
Thanks Received: 1

Are the 2 parameters of this function [this.TrueRangeSeries();] time and data stream. Would this function function use 30 minute time frame and second data stream:

this.TrueRangeSeries(30, 2);]

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

shamanov,

I don't think that you set the time frame with the input, as it's determined by the data stream (which is the second parameter). The first one is most likely bars back, although I'd suggest to test this so you are sure.

Regards,

ABCTG


shamanov View Post
Are the 2 parameters of this function [this.TrueRangeSeries();] time and data stream. Would this function function use 30 minute time frame and second data stream:

this.TrueRangeSeries(30, 2);]


Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
 Arch 
W.Coast, USA.
 
Experience: Intermediate
Platform: Anything
Trading: Emini
Posts: 347 since Jul 2017
Thanks Given: 106
Thanks Received: 381


ABCTG View Post
shamanov,

I don't think that you set the time frame with the input, as it's determined by the data stream (which is the second parameter). The first one is most likely bars back, although I'd suggest to test this so you are sure.

Regards,

ABCTG


are you able to access barsofdata(2) on a per tick basis when backtesting? I think the bar magnifier only applies to barsofdata(1), so even if you set the resolution to 1 tick, barsofdata(2) will always be on close or OHLC.

Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Arch,

that's correct when it comes to the bar magnifier or intra bar computations on higher data streams.

Regards,

ABCTG


Arch View Post
are you able to access barsofdata(2) on a per tick basis when backtesting? I think the bar magnifier only applies to barsofdata(1), so even if you set the resolution to 1 tick, barsofdata(2) will always be on close or OHLC.


Follow me on Twitter Reply With Quote




Last Updated on February 19, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts