Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLongLimit from different strategy

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

    ExitLongLimit from different strategy

    Is there any way to use 2 separate strategies one for entries, the other for exits?

    The reason is that I want the exit strategy to use CalculateOnBarClose=false, while the entry strategy is CalculateOnBarClose = true.

    Alternatively is there any way to use CalculateOnBarClose=true but selectively run some of the code only on the bar close (or vice-versa)?

    MindSabre

    #2
    No.

    But what I would do is have one strategy and set CalculateOnBarClose=false.

    Then filter your entry logic like:

    // Entry logic
    if (FirsTickOfBar)
    {
    if (Close[1] > Close[2])
    // Go long
    }

    Since you really want to process the close of the bar, you need to check for values 1 bar ago since you are on the first tick of the new bar.
    RayNinjaTrader Customer Service

    Comment


      #3
      Yes, but won't "if (Close[1] > Close[2])" compare closes of the past 2 *ticks* rather than the past 2 bars?

      How do I compare bars when CalculateOnBarClose=false ?

      Also how do I use indicators? Will the indicators calculate on actual bars or ticks?

      Comment


        #4
        You are *always* comparing bars, never ticks. The difference is, OnBarUpdate() is called on each incoming tick vs the close of each bar. The data references is either the close of the bar data or the bar data as it is in formation.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X