Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Multi TF arrows

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

    Multi TF arrows

    Hi guys! Need help with multi timeframe indicator.
    I want it to take the data from the different timeframes, and on the basis of logical events draw markers in a certain place of the chart.
    For example, EMA 5 crosses EMA 20 up at 1 min TF, the indicator draws up arrow. At 15 min TF EMA 5 is under 20 EMA , then the indicator draws the down arrow next
    to the previous one arrow up.
    I use:
    Add (PeriodType.Minute, TF1); / / (TF1 = 1 min)
    Add (PeriodType.Minute, TF2); / / (TF2 = 5 min)
    then I use
    double valueTF11 = EMA (BarsArray [1], period1) [0];
    double valueTF12 = EMA (BarsArray [1], period2) [0];
    double valueTF21 = EMA (BarsArray [2], period1) [0];
    double valueTF22 = EMA (BarsArray [2], period2) [0];
    then the logical processing and I draw arrows as shown in the
    CustomPlotSample. The problem is that TF = 1 minute everything is displayed correctly, but when I switch to another timeframe arrows do not appear. I need to
    display a set of arrows from others timeframes on any timeframe.
    Can you tell me what I'm doing wrong or how to solve this problem?

    Now, there are arrows on the M1, and when change the timeframe they disappear. The arrows indicate when the different timeframes MA arranged in order. Let's say when, for example, on the M5 MA 5, MA 20, MA 30, one below the other, respectively, second arrow down. When they are on the M5 in order up one above the other 5, 20, 30, the second of the arrow is up. Each arrow corresponds to a specific timeframe. The arrows disappear at any timeframe than M1. How to win it, do not understand!?

    P.S. I hope I do it right and clearly explained what my problem is. English is a foreign language for me and I have not had much experience of communication.
    Attached Files
    Last edited by Stock; 02-15-2013, 02:23 AM.

    #2
    Hello,

    What time frame are you switching to where the plots disappear?

    Are there any errors listed on the Log tab of the Control center? Specifically, anything related to the OnBarUpdate or Plot method?

    Are you sure your conditions are still true when you switch? You can verify this by using Print() statements and checking the Output window.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hellow, Matthew!
      Thank you for the replay. You're absolutely right. I've just noticed I have an error on the Log tab of the Control center. As you essume, the error related to the OnBarUpdate.
      "Error on calling "OnBarUpdate" method for indicator on bar 0: You ara accessing an index with a value that is invalid since its out of range. I.E. accessing
      a siries [barsAgo] with a value of5 when there are only 4 bars on the chart."

      I'll try to fix it.
      Last edited by Stock; 02-15-2013, 08:38 AM.

      Comment


        #4
        How to draw Arrow in a multiple time frame

        Hello Sir!

        I have a problem developing an indicator that will print arrow in the next time frame.
        My coding is in the primary chart and I want to execute my drawing of arrows in the secondary chart.

        Please help!

        Comment


          #5
          Hi,

          To clarify, you mean you have a two charts running, and would like when signals arrive on one chart, to draw on a second chart?

          Or do you have both time frames running in the same chart, just different panels?

          Does your indicator itself have both time frames added to it?
          MatthewNinjaTrader Product Management

          Comment


            #6
            Thanks for the reply

            Hi Matthew
            Yes I have two charts running and I have indicator and set it to primary chart, my problem is I want to command my indicator to print arrow on the secondary chart. Is there a code for that?
            Last edited by Danville.Sumobay; 11-21-2013, 11:20 AM.

            Comment


              #7
              Hi,

              It is not possible to send an object to another chart from your indicator. You would need the indicator to run on the same chart you wish to draw on.

              If your signals come from another time frame, you can add this time series to your script to process that information and then draw on the target time frame directly.

              Please see our Help Guide article on Multiple Time Frame for more information:

              MatthewNinjaTrader Product Management

              Comment


                #8
                Thank you for the clarification Sir!.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by fx.practic, 10-15-2013, 12:53 AM
                5 responses
                5,404 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by Shai Samuel, 07-02-2022, 02:46 PM
                4 responses
                95 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by DJ888, Yesterday, 10:57 PM
                0 responses
                7 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by MacDad, 02-25-2024, 11:48 PM
                7 responses
                159 views
                0 likes
                Last Post loganjarosz123  
                Started by Belfortbucks, Yesterday, 09:29 PM
                0 responses
                8 views
                0 likes
                Last Post Belfortbucks  
                Working...
                X