Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help with strategy code paste

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

    Need help with strategy code paste





    I need some help with creating a robot



    NinjaTrader Automated Trading Strategy



    The instructions say to do the following: Open Ninjatrader 2. From the Control Center, select New, Ninjascript Editor 3. Press +, select New Strategy, press Next, name it 'InsideBar', press Generate

    Now to instructions say to do the following: Paste the code from `inside_bar.cs` in the NinjaScript Editor window, Save and Compile



    The next step makes no sense, It says: Paste the code from `inside_bar.cs` in the NinjaScript Editor window, Save and Compile

    Can you look at the picture and tell me what line i paste the code to?

    [IMG]file:///C:%5CUsers%5CSean%5CAppData%5CLocal%5CTemp%5C~tmw0 %5C399861fe.tmp%5Cimg00001.PNG[/IMG]





    Attached Files
    Last edited by pcguy007; 08-24-2022, 06:12 AM.

    #2
    It would help if we could see what's inside inside_bar.cs, otherwise we have no idea if you are supposed to replace all the code, or just add new code to your new strategy.

    Comment


      #3
      added code to my post

      Comment


        #4
        Delete everything in your new strategy, InsideBar. Paste all the contents from inside_bar.cs into your strategy.

        Comment


          #5
          Getting an error when I enable the strategy
          Attached Files

          Comment


            #6
            Hello pcguy007,

            Thank you for your post.

            That error isn't from the strategy itself, it's because you're trying to load an expired contract - in the message there it says it's trying to load ES 09-20 and the current contract is ES 09-22. You'll need to roll to the latest contract to see live data.

            Please follow these steps to roll over the expiration date of a Futures contract:
            • Navigate to the Control Center > Tools > Database window.
            • Left-click the ‘Rollover’ button that appears just below the table under the ‘Rollover futures instruments’ section.
            • Close this window when this process completes.

            You can learn more about the different ways to rollover by visiting the link below:
            To view contract rollover, expiry dates, and other trading events click the link below.
            Please let us know if we may be of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            67 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            142 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            76 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            47 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            51 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X