Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry and Exits on 2 different strategies

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

    Entry and Exits on 2 different strategies

    I want to make 2 strategies,
    1 for Entry only on Price Change
    1 for Exit only on Bar Close

    Is it possible to do that and synchronize the 2 different strategies?

    #2
    Hello Ousher,

    Thanks for your post.

    Strategies are only able to see orders placed by that specific instance of the strategy. This means that if strategy 1 places an order, strategy 2 would not be aware of that order.

    Something you could consider doing is creating a single strategy that separates some logic to work OnPriceChange and other logic to work OnBarClose.

    Logic can be separated between Calculate.OnPriceChange and Calculate.OnBarClose using IsFirstTickOfBar. Please note that a hosted script will inherit the Calculate mode of the script that hosts it.

    You can take the following approach to differentiate logic between OnBarClose and OnEachTick processing. In your script, you would use OnPriceChange instead of OnEachTick.

    Please see this reference sample which demonstrates a technique used for those who need to separate their logic to calculate some values on each tick and others only on the close of a bar. You will set your host script to Calculate.OnPriceChange and use if(IsFirstTickOfBar) and place all code that needs to calculate once every bar within that condition check. Then place all code that you want to calculate OnPriceChange outside of the IsFirstTickOfBar condition check.

    SampleEnterOnceExitEveryTick -https://ninjatrader.com/support/help...either_cal.htm

    Please let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    56 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 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
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X