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 funk10101, Today, 09:43 PM
        0 responses
        6 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        44 views
        0 likes
        Last Post bill2023  
        Started by yertle, Today, 08:38 AM
        6 responses
        26 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        24 views
        0 likes
        Last Post algospoke  
        Working...
        X