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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X