Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Negative forecast value on the TSF indicator - what does it mean?

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

    Negative forecast value on the TSF indicator - what does it mean?

    Hi all,

    I'm playing around a bit with the TSF indicator and think it's interesting.

    If I understand correctly, the indicator uses the linear regression line or slope of the regression line from the past N periods and makes a forecast N periods into the future.

    However, it's also possible to use a negative forecast period. This dramatically changes the indicators apperance, but I don't fully understand the calculation or logic behind that.

    Can anyone please shed a light on this?

    It seems like the line is displaced somehow, but I still don't fully understand it.

    Thanks in advance to anyone who can help here.

    Johnny

    #2
    Hello Johnny,

    Thank you for the post.

    I wanted to clarify, are you asking why the script was developed to allow a negative to be used at all? If so I likely couldn't answer that specifically.

    I do see that you can use a negative in the input because it was not programmed to have a locked range above 0, that could be just an overlooked item that should have been added however there is no linked information for this indicator in the help guide for me to know if that was the case. Some indicators have specific sources which we link to that may provided additional information for the calculation used, for this item we just have the small description which does not specifically mention negatives. This specifically allows for a range of -10 and above so potentially it was intended to be like that.

    The reason why it changes the value is because the Forecast is used directly in the plotting logic for its calculation. By using a negative instead of a positive the calculation is using different values which produces a different result. In the code you can see ((myPeriod - 1) + Forecast which would be a smaller number instead of larger in this case which causes the remainder of the calculation to work differently.



    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jesse; 03-12-2020, 01:28 PM.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi, Jesse,

      Thank you! No, I do think it's quite correct that negative values are allowed. I just don't quite understand the calculation and would like to do that with something I will use to possibly risk money.

      Is there somewhere I can find the logic to better understand how this indicator work?

      Thanks.

      Johnny

      Comment


        #4
        Hello Johnny,

        Yes you can see how this item works using the NinjaScript editor. A majority of the system indicators are included as source code so that you can duplicate and edit them to fit your needs.

        From the control center click New -> NinjaScript editor and then use the Indicators folder to locate the file. If you open a file you can right click inside the document to Save As to duplicate it.

        If you wanted to remake this to not allow negative numbers at all you could simply change the property near the bottom of the file:

        Code:
        [B][Range(0, int.MaxValue)[/B], NinjaScriptProperty]
        [Display(ResourceType = typeof(Custom.Resource), Name = "Forecast", GroupName = "NinjaScriptParameters", Order = 0)]
        public int Forecast
        { get; set; }

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you, Jesse!

          That certainly helps.

          I'm not sure I fully understand it yet though.

          Best regards,

          Johnny

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          21 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X