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

Multi-time frame beginner

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

    #46
    converting code to Ninja 8 format

    Attached is my attempt to convert my little program to Ninja 8 format.

    My one primary object appears properly in my secondary 45 minute series, but does not appear with the 45 minute dimension in the primary series as it did in Ninja 7. Rather, it does the same calculations to draw the line with the bars in the primary series as it did in the 45 minute series.

    Can someone suggest a fix for this?

    To add a bit to this:
    By experimenting with drawIine parameters I found that using zero for startbarsago and -1 for endbarsago it drew the line horizontally where I wanted which was from the middle of bar 2 to the middle of the current bar in the 45 minute time frame. This is mysterious to me. Also if I asked to print High[0] in my program it would give me the high of the second bar in output, not the current bar as expected.

    At age 94 I am somewhat slow at learning this stuff.
    Attached Files
    Last edited by Pete77; 12-12-2016, 06:41 AM.

    Comment


      #47
      Hello,

      I wanted to post an update on this item. It appears that using indexes specifically will cause the exception you are getting, but using a Time does not produce an exception and seems to actually draw. I would still be against suggesting using future times/indexes in general as this concept was never supported to start with.

      Code:
      Draw.Line(this, "Tag2", true, Times[1][0], bp, Times[1][0].AddMinutes(1 * BarsArray[1].BarsPeriod.Value), bp, Brushes.White,DashStyleHelper.Dot, 5);
      Whether or not this produces the identical results as NT7 would be subject to your testing. In either case if this was or was not identical, I could not assist further as this is not really a suggested use.

      Please let me know if I may be of additional assistance.
      JesseNinjaTrader Customer Service

      Comment


        #48
        Thanks. Your suggested draw.line worked on the 45 min secondary series but not on the primary. I will stay away from trying to use any future data.
        Last edited by Pete77; 12-15-2016, 06:31 PM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        41 views
        0 likes
        Last Post alifarahani  
        Working...
        X