Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing indicator within strategies

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

  • lillomur
    replied
    Yes I did, I changed and compile the strength value to 15 before the test.

    I've tested right now with strength=5 and again the values are incorrect, as you can see in the attached image.


    My NT8 release is 8.0.10.0 64-bit (Standard)
    Attached Files

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello lillomur,

    Thank you for your response.

    The strategies I provided use a 5 strength Swing, can you confirm you changed this in code to 15 and compiled? If you leave the strategies at 5 strength and add a 5 strength Swing to the chart does it then report correctly?

    I look forward to your response.

    Leave a comment:


  • lillomur
    replied
    Hi PatrickH,

    Iv'e tried with your strategy "TestSwingHosted.cs" and the problem persists.

    As you can see in the image attached, in this example ( Strength = 15) SwingMin is calculated correctly up to 9:22 bar, but after that, de value change from 1.7327 to 1.7273.

    In this case SwingMax remain ok, but other times both values are incorrect.

    For NT7 I found the solution in this thread http://www.ninjatrader.com/support/f...ad.php?t=48386 and I thought would be the same in NT8.


    Thanks a lot for your help.
    Attached Files

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello lillomur,

    Thank you for your post.

    I am not seeing incorrect values in either NinjaTrader 8 or 7 when setting the Calculate for the indicator separate from the strategy. I am using Update() on the swing indicator in OnBarUpdate(), are you doing this as well?

    You can find my two test strategies attached.

    I look forward to your response.
    Attached Files

    Leave a comment:


  • lillomur
    started a topic Swing indicator within strategies

    Swing indicator within strategies

    In strategy script, SwingHigh and SwingLow values are incorrectly calculated by Swing indicator if Calulate Mode is "per tick" instead of "on bar close".

    With NT7 the solution was to create a named instance of the swing indicator an asign it the correct propertie:

    this.MySwing = Swing(str);
    this.MySwing.CalculateOnBarClose = true;


    In NT8 the equivalent I suppose is:

    this.MySwing = Swing(str);
    this.MySwing.Calculate= Calculate.OnBarClose;


    But in this case, the calculated values for SwingHigh and SwingLow ara incorrect and this workaround, that is ok for NT7, doesn't work with NT8.

    I would appreciate any sugestion that help me to solve this problem.

    Thanks in advance

Latest Posts

Collapse

Topics Statistics Last Post
Started by NullPointStrategies, 03-13-2026, 05:17 AM
0 responses
88 views
0 likes
Last Post NullPointStrategies  
Started by argusthome, 03-08-2026, 10:06 AM
0 responses
151 views
0 likes
Last Post argusthome  
Started by NabilKhattabi, 03-06-2026, 11:18 AM
0 responses
80 views
0 likes
Last Post NabilKhattabi  
Started by Deep42, 03-06-2026, 12:28 AM
0 responses
53 views
0 likes
Last Post Deep42
by Deep42
 
Started by TheRealMorford, 03-05-2026, 06:15 PM
0 responses
62 views
0 likes
Last Post TheRealMorford  
Working...
X