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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    72 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 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