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 algospoke, 04-17-2024, 06:40 PM
    6 responses
    48 views
    0 likes
    Last Post algospoke  
    Started by arvidvanstaey, Today, 02:19 PM
    4 responses
    11 views
    0 likes
    Last Post arvidvanstaey  
    Started by samish18, 04-17-2024, 08:57 AM
    16 responses
    61 views
    0 likes
    Last Post samish18  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    9 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    21 views
    0 likes
    Last Post traderqz  
    Working...
    X