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

Noob help needed: Creating an adjusted MA output based by using a multiplier

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

    Noob help needed: Creating an adjusted MA output based by using a multiplier

    Hello,
    I wonder how I could add the linear regression slope value into another indicator and use it as a multiplier inside a formula to adjust a visual MA indicator output.

    I mean, ideally the slope indicator should give me a value of X degrees (by a method described in this post or similar. I would like to then use the degrees inside a formula with two other multipliers Y (a fixed decimal number multiplier) and Z (an MA from an indicator) by the following
    (1+X*Y)*Z
    which would create an adjusted MA plot.

    Does anyone have a good reference link or a code snippet sample for doing the above?
    For example by using the basic LinReg and the LinRegSlope indicators.

    Thank you.

    #2
    Originally posted by MickeyHR View Post
    Hello,
    I wonder how I could add the linear regression slope value into another indicator and use it as a multiplier inside a formula to adjust a visual MA indicator output.

    I mean, ideally the slope indicator should give me a value of X degrees (by a method described in this post or similar. I would like to then use the degrees inside a formula with two other multipliers Y (a fixed decimal number multiplier) and Z (an MA from an indicator) by the following
    (1+X*Y)*Z
    which would create an adjusted MA plot.

    Does anyone have a good reference link or a code snippet sample for doing the above?
    For example by using the basic LinReg and the LinRegSlope indicators.

    Thank you.
    You may need to be careful here. Unless your scales have exactly the same values (i.e., 1 unit of price (in number of pixels/screen length) is exactly equal to 1 unit of time (in number of pixels/screen length), a slope will not look visually the way that you expect. IOW, what calculates to 45 degrees, for example, will look like 45 degrees if, and only if your scales are identical.

    Comment


      #3
      Thanks

      Originally posted by koganam View Post
      You may need to be careful here. Unless your scales have exactly the same values (i.e., 1 unit of price (in number of pixels/screen length) is exactly equal to 1 unit of time (in number of pixels/screen length), a slope will not look visually the way that you expect. IOW, what calculates to 45 degrees, for example, will look like 45 degrees if, and only if your scales are identical.
      I see. Thank you for your response. I actually think it's better to have someone who knows C# looking into this. So I posted a Job at Elance: Project AdjustedLinReg.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by quantismo, 04-17-2024, 05:13 PM
      3 responses
      25 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by ScottWalsh, 04-16-2024, 04:29 PM
      7 responses
      34 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cls71, Today, 04:45 AM
      0 responses
      5 views
      0 likes
      Last Post cls71
      by cls71
       
      Started by mjairg, 07-20-2023, 11:57 PM
      3 responses
      214 views
      1 like
      Last Post PaulMohn  
      Started by TheWhiteDragon, 01-21-2019, 12:44 PM
      4 responses
      547 views
      0 likes
      Last Post PaulMohn  
      Working...
      X