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

Previous Day's High Error

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

    Previous Day's High Error

    Hello All-

    I added a line of code on line 99 and now I am getting the Error on calling 'OnBarUpdate' method on 276 error message when I try to enable the script. I added the Print(Made it to Line) code. In the Ninjascript Output Made it to line 88 prints but not Made it to line 99 so I know the issue is in Set 1.

    Before adding the code on line 99, the script worked fine. What I am trying to do is tell the script to trade only if the current bid is higher than the high of yesterday. I thought I would just say something like Current Bid > than High on the daily candle from 1 day ago.

    Please see the attached photo showing what I am talking about.

    Thank you,

    Nick Click image for larger version

Name:	Previous Day High.PNG
Views:	67
Size:	56.4 KB
ID:	1194337

    #2
    Hello njmeyer713,

    From the image it looks like you started using 1 BarsAgo on a secondary series but you are not currently checking that at least 1 bar has loaded first.

    Please try changing line 86 to read as < 1 instead of < 0, that will check that the current bar for that series has at least 1 bar.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,403 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    7 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    159 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X