Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling same indicator in different time frames

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Calling same indicator in different time frames

    Hi,
    I need some help in my indicator design. can you please point me to some sample example.
    I have built the custom indicator by using all the available properties of a bar (close,high,low,open,volume). It is working as expected when applied to a chart or used in the strategy.
    Now I need to call the same indicator in different time frames in a strategy.
    Example: running strategy on 500 tick chart
    Indicator name : XYZ
    Parameters: A, B, C
    Return values: data series 1, data series2.
    In the strategy have below code to call the indicator.
    Variables section: Private XYZ myxyz;
    Onstartup: myxyz=XYZ(1,2,3);
    In onbarupdate: I am able to use the myxyz .dataseries 1, and myxyz .dataseries2 and the values are exactly matching with the values when I apply XYZ indicator to the 500 tick chart.
    Now I have added new data series (2000 tick) to the strategy using Add(PeriodType.Tick, 2000); in Initialize method.
    Need to get the values from XYX for 2000 tick data along with 500tick data.
    How do I pass this new data series to XYZ? Do I need to make any changes to XYZ indicator?

    i tried with below, looks like it is not working as i am using High,Low, Close, volume in XYZ
    Variables section: Private XYZ myxyz2000;
    Onstartup: myxyz2000=XYZ(Closes[1],1,2,3);

    Thanks
    gsreddy

    #2
    Hi,

    if i pass BarsArray[1] is it going to work?
    Onstartup: myxyz=XYZ(BarsArray[1] ,1,2,3);

    thanks
    gsreddy

    Comment


      #3
      Hi gsreddy, BarsArray[1] and Closes[1] would be equal - it would be the close data series passed then - you would need to pass each base data series needed to the indicator. Or do the multiseries calcs in the indicator directly, so it can just return the values needed for the strategy.
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Hi,

        thanks for the reply. i will add the second data series and add two more return data data series so that i can separate 500 tick output with 2000 tick output.

        thanks,
        gsreddy.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, 04-18-2024, 08:16 AM
        4 responses
        18 views
        0 likes
        Last Post trilliantrader  
        Started by mgco4you, Today, 09:46 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        9 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        10 views
        0 likes
        Last Post Rapine Heihei  
        Working...
        X