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 GLFX005, Today, 03:23 AM
    0 responses
    1 view
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    14 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    3 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X