Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DOES THIS LINE indicate that I was using a secondary data series

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

    DOES THIS LINE indicate that I was using a secondary data series

    I had this working on prior strategies but not on the one I am working on at this time


    if ((Position.MarketPosition == MarketPosition.Short)
    && (ShortTrades == true)
    && (TimeExit2 == true)

    && ((Close[1] > Open[1])
    || (Close[1] == Open[1])
    || (Close[1] < Open[1]))


    && (ToTime(Times[0][1]) == 092600))

    {
    ExitShort(Convert.ToInt32(Position.Quantity), @"STimeExit2", @"");

    }


    DOES THIS LINE indicate that I was using a secondary data series, (which would make sense to me as I used a non time based primary bar type)

    && (ToTime(Times[0][1]) == 092600))

    Thanks

    #2
    Hello DTSSTS,

    No, not necessarily. Using Times[0][1] would be the most recent bar of the primary series BarsInProgress 0.
    This would be fine to use even if no additional data series have been added with AddDataSeries() calls in State.Configure.

    If you want to know why the condition is not evaluating as true, print the time of the bar and all values in the condition along with labels for each value and comparison operator.

    Below is a link to a forum post that discusses using prints to debug and understand behavior.


    Are you certain that a non-time-based bar type is going to have a bar with a close time of exactly 9:26 am? (This seems unlikely)
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X