Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              596 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              343 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              556 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              554 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X