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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        58 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X