Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Strategy Builder

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

    Help with Strategy Builder

    Team

    Apologies if this is not the right place. I would like to build a Simple Strategy and need help in coding. Is there anyone who can volunteer, I dont mind paying for your service. There are only two conditions. I wrote the code and I get errors. Please send me a message.

    Thanks for your time.

    #2
    Hello NRITV,

    This thread will remain open for any community members that would like to take you up on your offer.

    Should you want to work on this script yourself, our NinjaTrader Engineering team is happy to answer any questions about errors or specific questions you have; we can also guide you through the debugging process.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank YOU!

      Here is the custom code I was embedding in the Strategy Builder but it does not fire on the Chart.
      Example CODE:

      protected override void OnBarUpdate()
      // Ensure the bar is complete and data is available
      // Check if the previous bar is a down bar
      {
      { if (CurrentBar < 1)
      return;

      }

      bool isDownBar = Closes[1][0] < Opens[1][0];
      if (isDownBar)
      {
      EnterLong("Buy on Open");
      }


      if (Position.MarketPosition == MarketPosition.Long)
      {
      // Close the position at the close of the current bar
      ExitLong("ExitLongOrder");
      }

      }
      }
      }

      It compiles perfectly fine but does not fire on the Chart.

      Thanks​

      Comment


        #4
        Hello NRITV,

        Are there errors appearing on the Log tab of the Control Center when enabling the strategy?

        I see you are trying to use Closes[1][0] and Opens[1][0].

        May I confirm a data series is being added with AddDataSeries() in the State.Configure logic block within OnStateChange()?
        Are you intending to run the log on BarsInProgress 0 and BarsInProgress 1?
        If not, have you added a check for the specific BarsInProgress you want to run the logic on?


        May I confirm you are checking CurrentBars[1] is greater than 0?
        Hello, I want to create an indicator that show data in a chart but calculate in other charttime different to the time of the chart where is showed. For example:




        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        23 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        120 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        63 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        45 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X