Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

To make a standard Fib setting as part of script

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

    #76
    Hello trdninstyle,

    That would not be nested that would be separate.

    Nest the FibLookBack branching command within the scope of the actionsOccurred logic block.

    If you are not familiar with scope, see the section on scope in the support article linked below.


    Also, below is a link to a 3rd party educational site on nesting if statements.
    The nested if in c# is an if statement that is the target of another if statement. A nested if statement specifies an if or if-else statement inside the other if statement. It is always legal in C# to nest if-else statements, which means you can use
    Chelsea B.NinjaTrader Customer Service

    Comment


      #77
      I just got it, I was hoping to respond with my correction before you responded. I didnt realize that I could nest it in like that. It works good, thank you. Sorry for trying your patients.

      That 3rd party is pretty good. I can click on live demo & highlight the curly brackets & see how they relate.

      Click image for larger version  Name:	2024-12-10 12_14_54-NinjaScript Editor - Strategy - Channels.png Views:	0 Size:	41.3 KB ID:	1327195
      Last edited by trdninstyle; 12-10-2024, 11:29 AM.

      Comment


        #78
        Okay, I think I may be in trouble because it's starting to get easy lol

        I also added another if statement for when if (NoLookBack == true) and it works, it draws a fib just on the current 3 bar channel.

        Click image for larger version  Name:	2024-12-10 13_03_11-2024_12_10_13_02_26_Chart_5m_RTH.png.png Views:	0 Size:	52.5 KB ID:	1327225
        This is cleaning up space in my script, a lot less command branches.

        Right now as expected, it draws when it applies, both the weaker channel and stronger channel. Thats when the weaker becomes stronger by that additional bar. I'm going to want to draw just the last one, which would be the stronger channel. That would be an else if statement, right?

        Screenshot just to see it.

        Click image for larger version

Name:	2024-12-10 13_26_11-Chart - 5m RTH.png
Views:	90
Size:	63.1 KB
ID:	1327227

        This is awesome
        Last edited by trdninstyle; 12-10-2024, 12:27 PM.

        Comment


          #79
          I want to have instructions that show up on the chart when the user clicks a tab for instructions from the interface.
          Thats where I'll lay out the attributes for a 90% and 70% probability for a second leg or channel.

          I left the option for the user to select either both fibs or one over the other in historic.
          Click image for larger version

Name:	2024-12-11 08_40_34-2024_12_11_08_39_25_Strategies.png.png
Views:	87
Size:	16.5 KB
ID:	1327292

          Comment


            #80
            Hello trdninstyle,

            You want to add controls over the chart?

            You can add WPF Controls the User Control Collection.
            Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

            Chelsea B.NinjaTrader Customer Service

            Comment


              #81
              "You want to add controls over the chart?"

              A lot of neat things I can do, been scanning over those links you gave me.

              For right now, my idea is from the indicator interface, have a button to click to see instructions that will show up overlaid onto the chart. Then unclick it to remove it.

              Click image for larger version

Name:	2024-12-11 09_57_50-Chart - 5m ETH.png
Views:	92
Size:	21.9 KB
ID:	1327315
              Click image for larger version

Name:	2024-12-11 10_11_25-2024_12_11_10_10_32_Strategies.png - Paint.png
Views:	81
Size:	2.0 KB
ID:	1327316
              Just to make sure I got this right.. below is the indicator interface right?
              Except it's from the strategy not indicator, adjust later.
              Click image for larger version

Name:	2024-12-11 10_13_57-Strategies.png
Views:	80
Size:	31.5 KB
ID:	1327317

              Comment


                #82
                Hello trdninstyle,

                If you want to draw text on the chart you can use Draw.Text(), Draw.TextFixed(), or custom render text in OnRender().

                The SampleCustomRender() included with NinjaTrader has sample code for rendering text in OnRender().

                Unfortunately, you haven't provided a screenshot of the entire window. This could be the Indicator properties window or the Strategy properties window or another properties window.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #83
                  Draw.Text(), Draw.TextFixed(), This goes under the on bar update? So this would draw text on the chart once user clicks to read instructions?
                  I'll have to put HighWinRate_Instructions == true in the command branch for Draw.Text, along these lines, right? Thankyou btw

                  I have the, HighWinRate_Instructions = false; and the Input Parameter for checking & unchecking.

                  Click image for larger version  Name:	2024-12-11 11_42_56-NinjaScript Editor - Strategy - Channels.png Views:	0 Size:	15.5 KB ID:	1327331 Click image for larger version  Name:	2024-12-11 11_43_56-NinjaScript Editor - Strategy - Channels.png Views:	0 Size:	11.2 KB ID:	1327332

                  Here's that screenshot again, I thought this was called the Interface where the user selects their items, I know it's also called the strategy properties window.
                  The part of a software application that a user sees and interacts with.

                  Click image for larger version  Name:	2024-12-11 11_39_31-2024_12_11_11_36_21_2024_12_11_11_35_42_Strategies.png.png.png Views:	0 Size:	54.2 KB ID:	1327333

                  Comment


                    #84
                    Hello trdninstyle,

                    Draw.Text() and other Draw methods can be called from OnBarUpdate() or called from a button click event handler method when using TriggerCustomEvent().

                    The UI (User Interface) would be the interface, which would include the control center and chart windows and controls visible in the application, including buttons added to a chart or a separate addon window. The specific UI window you have open in your most recent screenshot is the Strategies Properties window.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #85
                      Draw.Text(), Draw.TextFixed(),

                      This is how I did it, but it's not correct, the Draw.Text() is. How do I apply the Draw.TextFixed() please ?

                      Click image for larger version

Name:	2024-12-11 12_59_01-NinjaScript Editor - Strategy - Channels.png
Views:	85
Size:	11.3 KB
ID:	1327341

                      Comment


                        #86
                        Hello trdninstyle,

                        Below is a link to the documentation for Draw.Text() and Draw.TextFixed() with the overload signature.
                        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

                        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #87
                          I can copy & paste the samples and they come up on my chart but now how do I apply my bool to a set of instructions that user could click on then off? Read the instructions then carry on.

                          Comment


                            #88
                            Hello trdninstyle,

                            You could add a checkbox to the UserControlCollection and use the .IsChecked property or add an event handler to the .Checked event.



                            Or you could use a button and change a bool value and the button color or content text to represent on and off.

                            The Draw method would be called from a logic block checking the value of the bool.

                            The example below has an on / off for showing a plot.


                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #89
                              I imported the clone over ride but can't find it but I did import FixText indicator, that looks pretty good and I understand it. But it doesnt use on bar update.

                              I'll experiment tonight with all of these things see what I can come up with.


                              Comment


                                #90
                                Hello trdninstyle,

                                In the Indicators window it is in a folder named ChartingExamples.

                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by NullPointStrategies, Yesterday, 05:17 AM
                                0 responses
                                64 views
                                0 likes
                                Last Post NullPointStrategies  
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                139 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                75 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                45 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                50 views
                                0 likes
                                Last Post TheRealMorford  
                                Working...
                                X