Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 rbeckmann05, Yesterday, 06:48 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Working...
    X