Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Static Variable in Strategy Builder

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

    Static Variable in Strategy Builder

    Is there a static variable concept that i can use to share data between two separate trades?

    Example, I need to program that if two consecutive trades results in stop loss, do not enter the trade on same strategy again for same day

    Or if make two positive trades do not trade on same strategy on same day again.

    If I had a global static variable, I could use one for counting positive trades today and another one for loss trades today and keep a count of this.

    Any way to achieve this in Strategy builder?

    #2
    Hello myrx100,

    Strategy instances are not able to communicate with each other. To accomplish this, you will need to write these values to a text file and the read the values from the other strategy.

    This would not be possible to accomplish with the Strategy Wizard.

    Below is a link to a reference sample on writing to a file.
    http://www.ninjatrader.com/support/f...ead.php?t=3475

    And an reference sample on reading from a file.
    http://www.ninjatrader.com/support/f...ead.php?t=3476
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    58 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    39 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    19 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    21 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X