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

Strategy builder to enter using indicator color

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

    #16
    Dear Kate,

    Attached the error.

    Attached Files

    Comment


      #17
      Hello neshnix89,

      Thank you for your reply.

      You've simply pasted the entire example into your script and now you have 2 OnBarUpdate methods, which is causing the error. Showing the code within OnBarUpdate in the example was simply meant to show you where within the script you would want to put that logic, not that you're meant to copy the code wholesale.

      You will need to remove that copied in OnBarUpdate and then use that logic within it in your existing OnBarUpdate method.

      Please let us know if we may be of further assistance to you.
      Kate W.NinjaTrader Customer Service

      Comment


        #18
        Hi Kate,

        I would like to add anothet indicator called HACO i got from appshared in ecosystem. However im not able to choose the condition when the color of highloted area become green or red. Can you help to modified it to make it exposed so that i can choose the color in my strategy? Appreciate your help.
        Attached Files

        Comment


          #19
          Hello neshnix89,

          Thanks for your note.

          The HACO indicator is programmed to function exactly as discussed in the December 2008 Stocks and Commodities article titled "Trading With The Heiken-Ashi Candlestick Oscillator" authored by Sylvain Vervoort.

          In the Support department at NinjaTrader, it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

          That said, you could modify the HACO indicator yourself to accomplish your goal. The HACO BackBrushAll property is set to use the PanelColorRising user-defined property (green by default) when the 'upw' bool is true. When the 'dnw' bool is false, the HACO BackBrushAll property is set to use the PanelColorFalling user-defined property (red by default).

          You could consider adding a plot to the script using the AddPlot() method. You could check if the 'upw' bool is true in the script and assign the plot a value of 1. You could check if the 'dnw' bool is true and assign the plot a value of 0.

          Then, you could reference that indicator plot in a Strategy Builder strategy to compare if the plot is 0 (BackBrushAll is red) or 1 (BackBrushAll is green).

          AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm

          This forum thread will also be open for other community members to share their insights or modify the code for you.

          Let me know if I may assist further.
          Last edited by NinjaTrader_BrandonH; 11-01-2022, 10:46 AM.
          Brandon H.NinjaTrader Customer Service

          Comment


            #20
            Hello everyone, I have a same request from above. I have a strategy I'm using but I need this indicator named CAM (File attached). I need someone to recreate this indicator to show a value when bar are green or red.​ Thank you
            Attached Files

            Comment


              #21
              Hello pickles1774,

              Thanks for your note.

              As stated in post # 19, in the Support department at NinjaTrader, it is against our policy to create, debug, or modify, code or logic for our clients.

              That said, if you are interested modifying the script yourself, Draw.Text() or Draw.TextFixed() could be used to draw text on a chart, such as a value, when a certain condition occurs.

              See the help guide documentation below.

              Draw.Text(): https://ninjatrader.com/support/help.../draw_text.htm
              Draw.TextFixed(): https://ninjatrader.com/support/help..._textfixed.htm

              This forum thread will be open for other community members to modify the script for you if they wish to do so or share their insights.

              Please let me know if I may assist further.
              Brandon H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              0 views
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              2 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,262 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              10 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X