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

Adding Lines to indicator?

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

    Adding Lines to indicator?

    Greetings,

    2 Question on adding lines to an existing indicator.

    For example, an existing Stochastic indicator:

    I want to add multiple lines with the option to change the color, style, value and width?

    I want to add a specific range within the Stochastic indicator and have that range in a color. I would like the option change the opacity, color, style, value and width?

    What code would do this, and where would it be inserted?

    Thank you.

    Joseph

    #2
    Hello Joseph,

    You can start by creating a new indicator with the original code from another indicator. To do this go the Control Center -> Tools -> Edit NinjaScript -> Indicators. Then double left click on the indicator that you want to have the original code from for example the "Stochastics". It will then open up the source code for the indicator. Right click inside the window and select Save As. Type in a name of your choosing then press "Save". Press the "OK" button. Now you have a new indicator based off the system indicator code that you can modify to add more lines.

    Here is a link to our Help Guide that goes over the DrawLine() method inside of NinjaScript where you can cutomize the color, style, value, and width of a line.


    You may view the following thread for a reference sample on how to draw objects.


    You can create condition(s) to change the color, style, value, and width of your line, but opacity the DrawLine() method does not have.

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank you!!

      Great stuff JC!!
      Thank you!!

      Originally posted by NinjaTrader_JC View Post
      Hello Joseph,

      You can start by creating a new indicator with the original code from another indicator. To do this go the Control Center -> Tools -> Edit NinjaScript -> Indicators. Then double left click on the indicator that you want to have the original code from for example the "Stochastics". It will then open up the source code for the indicator. Right click inside the window and select Save As. Type in a name of your choosing then press "Save". Press the "OK" button. Now you have a new indicator based off the system indicator code that you can modify to add more lines.

      Here is a link to our Help Guide that goes over the DrawLine() method inside of NinjaScript where you can cutomize the color, style, value, and width of a line.


      You may view the following thread for a reference sample on how to draw objects.


      You can create condition(s) to change the color, style, value, and width of your line, but opacity the DrawLine() method does not have.

      Let us know if we can be of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cre8able, Yesterday, 07:24 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cocoescala, 10-12-2018, 11:02 PM
      6 responses
      939 views
      0 likes
      Last Post Jquiroz1975  
      Started by gbourque, Today, 06:39 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by benmarkal, Yesterday, 12:52 PM
      3 responses
      23 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X