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 detect drawings/create new values?

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

    Strategy Builder detect drawings/create new values?

    Is there a way for Strategy Builder to detect the drawing of a triangle?
    I have been running into the problem in multiple indicators that don't show values when they trigger - they just draw.

    In the case of the D3Spotter it draws a triangle. Is there a simple way for strategy builder to detect this?

    Or can I simply resave this code as a custom indicator -- and insert a line of code so that when the draw triangle conditions are triggered it also assigns a value (1 or -1) to that long/short action so I can call on this new indicator from a strategy builder strategy?

    (indicator attached)
    Thanks!
    Attached Files
    Last edited by TomTownsend; 01-10-2021, 10:04 AM.

    #2
    Hello TomTownsend,

    The indicator would need to set a plot value that can be used as a signal to a host script.

    Below is a link to an example.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you. I am very new to all this so I want to try to clarify what you are suggesting and what the steps would be if I can figure it out.

      1) I could make a new version of the indicator in Ninjascript by borrowing the old script and setting a plot value for when it draws triangles.
      2) I can figure out how to add this plot value his by looking at the sample you posted.
      3) Once created with these plots I can now call on them in my strategies.

      Is that correct?
      Thanks!

      Comment


        #4
        Hello TomTownsend,

        You can choose to copy the script if you would like, if the script is open source.


        Yes, the example I have provided shows how to set a plot value in an indictor when an action happens.

        Yes, indicator plots can be called from a host script like a strategy.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          After hours of trying I'm still at step 1.
          Can you please point me to simple instructions on copying and pasting the existing open source code into a new cs file in Ninjascript so I can try to edit it based on the sample above as a new version of the indicator?
          Thank you.

          Comment


            #6
            Hello TomTownsend,

            Have you opened the script in the NinjaScript Editor?
            Did you right-click the code and select Save As?
            Have you given the copy a new unique name?
            Did you click Save?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Open and Save As, much easier way to start, thanks!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bmartz, 03-12-2024, 06:12 AM
              4 responses
              31 views
              0 likes
              Last Post bmartz
              by bmartz
               
              Started by Aviram Y, Today, 05:29 AM
              4 responses
              12 views
              0 likes
              Last Post Aviram Y  
              Started by algospoke, 04-17-2024, 06:40 PM
              3 responses
              28 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by gentlebenthebear, Today, 01:30 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by cls71, Today, 04:45 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X