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

A little help?

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

    A little help?

    In my first attempt to create an indicator, I've had mixed success. The attached indicator is based on the TSF indicator that comes with Ninja. I used the "SampleMultiColoredPlot" that's available on this forum as my base code. The line produced by the TSF indicator is supposed to change color based on the value of the slope of the linear regression line of the underlying security.

    Here's what I don't understand: this thing works fine for ES, YM, NQ, FDAX. But, for ZB, 6E and CL (and probably others - haven't checked), all I get is a yellow line (the "neutral" color). How can this thing be instrument dependent?

    My apologies for hard-coding the "angle" parameter. Couldn't quite figure out how to pass the thing as a user-defined value.

    One other thing: how can I get this thing to stop lagging the current price? I tried setting "CalculateBaronClose" to FALSE, but it made no difference.

    Thanks in advance for any help on this.
    Attached Files

    #2
    Suggest you use Print()s in your code to identify what values are evaluated as for the instruments you feel are not working.

    Not sure what you mean by lagging behind. With CalculateOnBarClose = false it will set a plot to the most recent bar. Be sure to be adding a new instance of your strategy if you are making these changes via code.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh
      i am having trouble with a bit of code, this is the sample of code, the editor reports "statement expect" would the Print() tell me what the means? if so where do i place the Print() in the code?

      bc +=cc
      Values[bc = 6].Set(Volume[0]);

      Comment


        #4
        Your first line there needs to end with a semi colon.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          thanks i got all the errors gone

          Comment


            #6
            nevermind, errors have new issues

            Comment


              #7
              Address the errors one step at a time and when they are all finally addressed you will be able to compile.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by frankthearm, Today, 09:08 AM
              6 responses
              24 views
              0 likes
              Last Post frankthearm  
              Started by maybeimnotrader, Yesterday, 05:46 PM
              4 responses
              23 views
              0 likes
              Last Post maybeimnotrader  
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              33 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              7 responses
              32 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by merzo, 06-25-2023, 02:19 AM
              10 responses
              823 views
              1 like
              Last Post NinjaTrader_ChristopherJ  
              Working...
              X