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

How to get static override correct

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

    How to get static override correct

    Hi Team/Fellow Users
    I have manipulated some code I found and have a multiple risk reward indicator that works very nicely as a DrawingTool.

    MultipleRR.zip
    However I cannot for the life of me work out the static override so that I can Draw.MultipleRiskReward(.......)

    Is there anyone that can provide some help or assistance and then I can place it in the UserApp section for others to use.
    Attached Files
    Last edited by Mindset; 07-16-2023, 02:15 AM.

    #2
    Instead of 'static override' you can try using 'static new'.

    Good reading here,

    Comment


      #3
      Hello Mindset,

      Thanks for your post.

      You will need to create a static partial Draw class at the bottom of the DrawingTools file.

      You could view the static partial Draw class at the end of any DrawingTools file to get an idea of how this would be done.

      For example, you could view the RiskReward file in the DrawingTools folder in the NinjaScript Editor window to see the static partial Draw class in that file.
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Ok thanks. This is way outside of my knowledge zone but I will give it a go.

        Comment


          #5
          Sorry this is beyond my capabilities.
          The code I manipulated is fibonacci retracements rather than RiskReward and I can copy the partial class over but it doesn't help me with the static draw override. Ive tried a few combinations but I am not understanding the Class reference. If I reference anything other than fibonnaci retracements it produces errors even though the Class appears to be WCJRiskRewardR??
          I will admit defeat on this one as it works perfectly using the mouse and after so many hours of looking at stuff there are other things i need to do - I would just love to have had the ability to use it in NS.
          Last edited by Mindset; 07-17-2023, 02:31 AM.

          Comment


            #6
            Hello Mindset,

            Thanks for your notes.

            I suggest that you study the public static partial Draw class at the bottom of any of the DrawingTools files in the NinjaScript Editor window to get an understanding of how this class would be set up and works.

            Then, you could create your own public static partial Draw class at the bottom of your custom DrawingTool and implement similar logic see in the other DrawingTool files.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Haiasi, 04-25-2024, 06:53 PM
            2 responses
            16 views
            0 likes
            Last Post Massinisa  
            Started by Creamers, Today, 05:32 AM
            0 responses
            5 views
            0 likes
            Last Post Creamers  
            Started by Segwin, 05-07-2018, 02:15 PM
            12 responses
            1,786 views
            0 likes
            Last Post Leafcutter  
            Started by poplagelu, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post poplagelu  
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,407 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Working...
            X