I know you said you installed the Ninja files that come with Adaptrade Builder, but the error message suggests that’s the problem. “LastBarOfSession” is defined in one of those files. I was able to compile your strategy code without errors. You should keep in mind that when you right-click the code pane and select “Save NinjaScript Strategy to File”, the program presents a default directory/folder location for saving. In most cases, that’s the correct folder, but it ultimately depends on how you installed NT7, and it’s up to you to make sure that’s the correct folder. If it’s not, you will most likely get compilation errors when it can’t find the other files it needs in the proper locations. Likewise, if the Builder-provided files are not in the proper locations, you will get an error.
One way to verify that the Builder files are in the proper place is to look for them via the editor. If you select “Edit NinjaScript” -> “Strategy” from the Tools menu, you should see “AS_OrderProcessing” and “AS_NNCompute”. And the strategy you’re trying to compile should be in that same location. If the strategy you’re trying to compile is not in the same location as those other files, you need to move it to the same folder. Likewise, if you view the available indicators from the Tools menu, you should see all the indicators from Adaptrade (AS_AdaptICyc, AS_AdaptIRSI, etc.). If they’re in a different folder, you should move them to the same folder as the other Ninja indicators.
Mike Bryant
Adaptrade Software
Unfortunately for debugging purposes, the error messages generated by the NinjaScript editor do not always point us in the right direction, as I’ve seen before. Assuming you’ve made no changes to either the strategy code in question or the AS_OrderProcessing file, the problem could be elsewhere. A problem in any file could trigger an error that the editor attributes elsewhere. Nonetheless, if you haven’t already done so, I’d copy the entire AS_OrderProcessing.cs file directly from the Builder folder in Program Files (e.g., via something like NotePad) and paste it over the version in the Ninja editor just to make sure there is no problem with the code in Ninja.
Other than that, since you only have a few files in the Strategy folder, unless you’ve edited any of them, I don’t know what to suggest. Your setup is the same as mine, which is the default, and there are no issues with it that I can find.
Mike Bryant
Adaptrade Software
From: adaptrad...@googlegroups.com <adaptrad...@googlegroups.com> On Behalf Of zumran hamid
LastBarOfSession is defined right near the top of that file:
namespace NinjaTrader.Strategy
{
/// <summary>
/// This file holds strategy methods required by Adaptrade Builder strategies.
/// </summary>
partial class Strategy
{
// Variables for order processing
private IOrder LongEntryOrder = null;
private IOrder ShortEntryOrder = null;
private IOrder LongExitMarkOrder = null;
private IOrder LongExitStopOrder = null;
private IOrder LongExitTargOrder = null;
private IOrder ShortExitMarkOrder = null;
private IOrder ShortExitStopOrder = null;
private IOrder ShortExitTargOrder = null;
protected bool LastBarOfSession = false;
Mike Bryant
Adaptrade Software
From: adaptrad...@googlegroups.com <adaptrad...@googlegroups.com> On Behalf Of zumran hamid
Sent: Wednesday, April 29, 2020 6:31 AM
Subject: Re: Ninjatrader 7 strategy compiling error Help
Done that but it did not solve the problem. I can not find any reference of lastbarofsession in AS_orderprocessing file. In ninjascript if you hover your mouse over lastbarofsession it shows nothing but if you you hover over sessionendtime or Time[0] it would show adaptrade related language.
I’m not sure how that happened, but I appreciate you taking the time to figure it out. I’ll make sure the download file for 2.5 is updated to include the most up-to-date Ninja 7 zip. If anyone else has had this issue, please let me know so I can send the correct file.
Mike Bryant
Adaptrade Software
From: adaptrad...@googlegroups.com <adaptrad...@googlegroups.com> On Behalf Of zumran hamid
Sent: Thursday, April 30, 2020 3:23 AM
Subject: Re: Ninjatrader 7 strategy compiling error Help
Finally problem is solved. This is this line missing from AS_orderprocessing file which comes with default installation of the adaptrade 2.5, i have examined all of my adaptrade installations. I see that this is 2014 file, may be Bryant has newer file on his computer but install contains older file. Just my guess. See below
--
You received this message because you are subscribed to the Google Groups "Adaptrade Builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adaptrade-buil...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adaptrade-builder/001f01d61f31%2446872990%24d3957cb0%24%40BreakoutFutures.com.
I've attached the correct Ninja 7 zip file for Builder 2.5. I’m
finishing up version 3 of Builder now, so the download file on your license
page at SoftwareKey.com will be updated with that version soon, which will
include the correct zip file for NT7 as well as the new zip file for NT 8. Also, anyone who has any version of Builder
between 2.3.0 and 2.4.1 installed has the correct version of the NT7 zip in the
installation folder, so you can get it from there as well. That means it’s
also available on the web site via the trial downloads for those versions. If
anyone has difficulty getting it from any of those sources and wants me to send it directly, just PM me.
Mike Bryant
Adaptrade Software