Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing Strategy

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

    Swing Strategy

    Hi,I'm trying to build a swing strategy with the strategy builder,but I have some difficulties on how to set the swing indicator as output for my entry.

    Are there some examples?
    Thanks

    #2
    Hello Italianforex,

    Thanks for your post.

    The strategy builder only has access to the SwingHigh or SwingLow values, relative to the bars ago value selected. To understand and visualize what the strategy builder is using you can create a set that draws an object (such as a dot, arrow, square, etc) at the current bar value of the SwingHigh or SwingLow. I've attached an example of this in a strategy builder strategy you can test with. It will show the swing indicator on the chart (with the normal dots) and will add up/down triangles to show where the code identifies the swing high and low. (I've offset the triangles by 2 ticks each way to show them clearly as otherwise they would be at the same price level as the swing dots and would be obscured where they overlap) The (time) difference between the dots and triangles is the number of bars of the strength setting (5 by default) and this is an important concept to understand when using the swing indicator in a strategy.

    Click image for larger version

Name:	Swingvisualized.PNG
Views:	1879
Size:	50.1 KB
ID:	1060057

    [ATTACH]n1060058[/ATTACH]

    Comment


      #3
      Hi,thanks for the reply,but I can't really understand how i can set the output for my entry,there is no crossover or anything that give me an input to enter the trade.

      Comment


        #4
        Hello Italianforex,

        Thanks for your reply.

        The example code was to help you see what the strategy builder actually sees as the values of the swings and when those swing points are known. In the screenshot in post 2, on the left side, you can see where price crossed above the swing high in the uptrend, 4 times. In the strategy builder, you can check for price crossing above a swing high or crossing below a swing low. You would want to study the swing indicator on your instrument(s) to see if there are other conditions that would help to confirm an entry point.

        Comment


          #5
          How can I set to buy/sell from the swing high/low...let's say to sell if the current bar is below the swing high more than 10 ticks...can't find nothing to do it.

          Thanks
          Last edited by Italianforex; 06-11-2019, 07:52 PM.

          Comment


            #6
            Hello Italianforex,

            Thanks for your reply.

            In the strategy builder, you would use Close and offset it by 10 ticks and then check to see if it is less than the swing high (or you can subtract 10 ticks from the swing high). I've attached an example that I added to the swing visualizer to draw on the chart a magenta down arrow where that condition is true. (Close + 10 ticks less than the swing high).


            Click image for larger version

Name:	ItalianForex-1.PNG
Views:	1367
Size:	69.8 KB
ID:	1060517

            Comment


              #7
              Hi,
              i followed the steps and tried to add the Down Arrow, but this arrow doesnt appear for the charts that i am looking at. Can you please help? Does it require 1 min data itself for showing the details, I have used the daily chart. code snippet as below:

              }
              else if (State == State.Configure)
              {
              }
              else if (State == State.DataLoaded)
              {
              Swing1 = Swing(Close, 5);
              }
              }

              protected override void OnBarUpdate()
              {
              if (BarsInProgress != 0)
              return;

              if (CurrentBars[0] < 2)
              return;

              // Set 1
              if ((Close[0] + (10 * TickSize)) < Swing1.SwingHigh[0])
              {
              Draw.ArrowDown(this, @"CheckStrategy Arrow down_2", true, 0, (High[0] + (5 * TickSize)) , Brushes.Red);
              Draw.Text(this, @"CheckStrategy Text_1", @"SPH", 0, (High[0] + (10 * TickSize)) );
              }

              Attached Files

              Comment


                #8
                Hello prodigaltrader,

                I've answered the post in your original thread: https://ninjatrader.com/support/foru...um#post1139128

                Please do not double post as there is no point in answering 2 posts on the same subject in different threads. Thanks for your understanding.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                62 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                134 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