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

Working on Multi timeFrame

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

    Working on Multi timeFrame

    Hello:
    Anyone out there please HELP!!!!!

    I'm Trying to Program an indicator, uses Multitime frame. gives me potential entry and exit signals. No apparent syntax errors, but when I apply it to my Chart, it does not work. However, If I Apply it in one time frame only, it does work but gives me unwanted signals. I realized that I did not need to use BarsArray[0] but I did any ways. The Script is long, because it has several triggers, this one is only and example. when in one time frame only, Changing only 1 BarArray from [0] to [1], renders the entire indicator useless. opened the output window and does not send any message.

    protectedoverridevoid OnBarUpdate()
    {

    if ( CrossAbove(RSI(BarsArray[1],14,3),30,3)
    && Rising(MACD(BarsArray[1],12,26,9).Avg))
    { if (CrossAbove(RSI(BarsArray[0],14,3),30,5))
    {
    if (Close[0]> Close[1]
    && Close[0]>= Open[1])
    {
    Entry
    .Set(Low[0]-1* TickSize);
    isitBull
    =false;

    }
    }
    }

    #2
    Hello YandyChang,

    Thank you for the post and welcome to the forums!

    Do you see any errors in the Log Tab of the Control Center?

    Are you using a current bar check in the script to ensure that you have enough data for the indicator to work with?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      I did use first a CurrentBar Statement made it Greater than 50. Saw this troubleshoot in another thread but it Didn't help( unless Im doing it wrong). at this moment I don't have the CurrentBar Statement.https://www.dropbox.com/s/ry7v9ial3n...2010.11.21.png. This is a ScreenShot of the log Tab.
      Thanks for your help, its appreciated..

      Comment


        #4
        YandyChang,

        I will need to see the script to further assist you in the investigation.

        You can attach it to your post by clicking Go Advanced and selecting the Paperclip icon on the toolbar

        You will find your script in (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Indicator
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          ok, here it is

          Thanks, hope to here from you...
          Last edited by Yandychang; 02-27-2014, 03:38 PM.

          Comment


            #6
            YandyChang,

            How many days to load are you inputting for the primary data series?

            I was able to load 30 days and get responses to come through however, the second IF where you are checking over bought you have this line of code -

            Close[0]< Close[1] && Close[0]>= Open[1]

            This will never become true.
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              What I was trying to do is finding a lower low, I can fix that part... Check if During initialization you have two Add statements for timeframe: One is 500 ticks( index 1), the other is 1500 ticks( index 2). If thats the case then it should work( since Here index 1 is also index 0). If you take the Add statement for the 500 ticks off( thus making 1500 ticks bar index 1), then the problem will come up. Ill check your 30 days solution on my side and see if it works.
              Last edited by Yandychang; 02-27-2014, 12:34 PM.

              Comment


                #8
                I think this is what I was trying to say: Close[0]< Close[1] && Close[0]<= Open[0],
                Last edited by Yandychang; 02-27-2014, 12:23 PM.

                Comment


                  #9
                  30 days doesn't fix it...

                  Comment


                    #10
                    YandyChang,

                    I forgot to include that you need to do a current bar check for all your data series -

                    Code:
                    if (CurrentBars[0] < 50 || CurrentBars[1] < 50) return;
                    Put that in and try running it
                    Cal H.NinjaTrader Customer Service

                    Comment


                      #11
                      Actually it seems to have worked... thank very much... I wouldnt have been able to come up with this solution, since Im new at this thing about programming... you saved me a lot of frustration....
                      Last edited by Yandychang; 02-27-2014, 03:26 PM.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Jonker, Today, 01:19 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post Jonker
                      by Jonker
                       
                      Started by futtrader, Today, 01:16 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post futtrader  
                      Started by Segwin, 05-07-2018, 02:15 PM
                      14 responses
                      1,789 views
                      0 likes
                      Last Post aligator  
                      Started by Jimmyk, 01-26-2018, 05:19 AM
                      6 responses
                      838 views
                      0 likes
                      Last Post emuns
                      by emuns
                       
                      Started by jxs_xrj, 01-12-2020, 09:49 AM
                      6 responses
                      3,294 views
                      1 like
                      Last Post jgualdronc  
                      Working...
                      X