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

    Hello trdninstyle,

    Was is the full branching command you are investigating?

    Please provide the text instead of screenshot.
    Chelsea B.NinjaTrader Customer Service

    Comment


      Okay, I did start out w/ the strong command branch then noticed the weaker command branch printed out first lately.

      The weaker (CB) Command Branch starts out but then the stronger CB gets added on top of the weaker CB but by one bar & it remains visible, its the one green bar before the 3 white bars.
      Then the bar following the last white bar closes below that white bars high so starts out as weak, the nxt 3 bars (green).

      Its these two CB's that overlap that I'm investigating.

      Comment


        Hello trdninstyle,

        Was is the full branching command you are investigating?

        Please provide the text instead of screenshot.​
        Chelsea B.NinjaTrader Customer Service

        Comment


          Weaker:

          && (Close[2] > Open[2])
          && (Close[1] > Open[1])
          && (Close[0] > Open[0])

          && (Close[2] <= High[3]) //**
          && (Close[1] > High[2])
          && (Close[0] > High[1])

          && (Low[1] > Low[2])
          && (Low[0] > Low[1])


          Stronger:

          ((Close[2] > Open[2])
          && (Close[1] > Open[1])
          && (Close[0] > Open[0])

          && (Close[2] > High[3])
          && (Close[1] > High[2])
          && (Close[0] > High[1])

          && (Low[1] > Low[2])
          && (Low[0] > Low[1])


          Its when these two overlap over another and in either order.
          Sorry, didnt realize this is what you meant.
          Last edited by trdninstyle; 12-24-2024, 01:30 PM.

          Comment


            Hello trdninstyle,

            Which specific one branching command are you investigating first?

            Are you certain you provided the full branching command and didn't leave anything out?
            Branching commands start with the the keyword 'if'.
            Chelsea B.NinjaTrader Customer Service

            Comment


              I'll start w/ the stronger one first. It paints bars solid color then adds bar outline if the weaker overlays it.

              if ((Close[2] > Open[2])
              && (Close[1] > Open[1])
              && (Close[0] > Open[0])

              && (Close[2] > High[3])
              && (Close[1] > High[2])
              && (Close[0] > High[1])

              && (Low[1] > Low[2])
              && (Low[0] > Low[1])
              && BarBrushes[3] != Brushes.Aquamarine)

              {
              BarBrushes[0] = MyBrush;
              BarBrushes[1] = MyBrush;
              BarBrushes[2] = MyBrush;


              if (weakerChannel == true)
              {
              CandleOutlineBrushes[0] = MyBrush;
              CandleOutlineBrushes[1] = MyBrush;
              CandleOutlineBrushes[2] = MyBrush;
              Print(string.Format("{0} | condition true", Time[0]));
              }
              }

              Comment


                Hello trdninstyle,

                For this branching command:

                if ((Close[2] > Open[2])
                && (Close[1] > Open[1])
                && (Close[0] > Open[0])

                && (Close[2] > High[3])
                && (Close[1] > High[2])
                && (Close[0] > High[1])

                && (Low[1] > Low[2])
                && (Low[0] > Low[1])
                && BarBrushes[3] != Brushes.Aquamarine)​

                The print added one line above the branching command would appear:

                Print(string.Format("{0} | Close[2]: {1} > Open[2]: {2} && Close[1]: {3} > Open[1]: {4} && Close[0]: {5} > Open[0]: {6} && Close[2]: {1} > High[3]: {7} && Close[1]: {3} > High[2]: {8} && Close[0]: {5} > High[1]: {9} && Low[1]: {10} > Low[2]: {11} && Low[0]: {12} > Low[1]: {10} && BarBrushes[3]: {13} != Brushes.Aquamarine: {14}", Time[0], ​​Close[2], Open[2], Close[1], Open[1], Close[0], Open[0], High[3], High[2], High[1], Low[1], Low[2], Low[0], BarBrushes[3], Brushes.Aquamarine));
                Chelsea B.NinjaTrader Customer Service

                Comment


                  Thank you for demonstrating how the print should look like.

                  "The print should be one line above the branching command..."

                  Not like this?

                  Print(string.Format("{0} | Close[2]: {1} > Open[2]: {2} && ...
                  if ((Close[2] > Open[2])
                  && (Close[1] > Open[1])
                  && (Close[0] > Open[0])

                  && (Close[2] > High[3])
                  && (Close[1] > High[2])
                  && (Close[0] > High[1])

                  && (Low[1] > Low[2])
                  && (Low[0] > Low[1])
                  && BarBrushes[3] != Brushes.Aquamarine)

                  I removed the prior print I had from before, incase it was causing an interference w/ this new one. It's saying an Expression is expected.

                  Click image for larger version

Name:	2024-12-26 11_39_08-NinjaScript Editor - Strategy - NestedChannels.png
Views:	89
Size:	30.4 KB
ID:	1329181 Click image for larger version

Name:	2024-12-26 11_39_43-NinjaScript Editor - Strategy - NestedChannels.png
Views:	72
Size:	16.8 KB
ID:	1329182 ​

                  Comment


                    Hello trdninstyle,

                    If you have copied and pasted from the forum, you may have hidden character causing the error.

                    Try removing the lines and compile and confirm there are no errors.

                    Then type the line by hand.
                    Chelsea B.NinjaTrader Customer Service

                    Comment



                      I only see this line.

                      Click image for larger version

Name:	2024-12-26 12_09_18-2024_12_26_12_08_55_NinjaScript_Editor_Strategy_NestedChannels.png - Paint.png
Views:	65
Size:	3.3 KB
ID:	1329185

                      I copy paste line by line from the forum this time and as I looked for more of those lines, I noticed one count had {1} in between a count set, and a {3}, I just noticed that one as I was proofing my pic.

                      Click image for larger version

Name:	2024-12-26 12_13_44-2024-12-26 12_07_06-2024_12_26_12_06_01_NinjaScript_Editor_Strategy_NestedChanne.png
Views:	62
Size:	3.1 KB
ID:	1329186
                      The &&Close where its touching, is the next line that I pasted.

                      Comment


                        Hello trdninstyle,

                        "Try removing the lines and compile and confirm there are no errors."

                        I am meaning lines of code. Not the vertical line character.

                        Sometimes when copying and pasting from the forum can introduce hidden characters.

                        The character will not be within the string.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          Okay, I'll start doing that. What I was doing was slowly typing in everything by hand but that step would be quicker.

                          Comment


                            Hello trdninstyle,

                            I've exported a test indicator with the print and condition.
                            Attached Files
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              I continued typing the print out by hand and it compiled, if it didn't compile I would have removed the lines of code.

                              "Save the output to a text file and include this with your reply."

                              I'll go ahead and do the above now. I'll see if I can figure it out about saving it to a text file. Think I know how.

                              Comment


                                Okay, I see. I do keep Print(string.Format("{0} | condition true", Time[0])); and place in the logic block. Awesome.
                                I imported the file you just provided, thank you.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by NullPointStrategies, Yesterday, 05:17 AM
                                0 responses
                                65 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