Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Separate scripts for multiple instruments

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

    Separate scripts for multiple instruments

    Hi,

    I'm using MBT forex.
    New to ninjascript. Hope to start using it shortly.

    When I'm trading two different instruments (say EUR/USD and USD/CHF), I would like to have two different ninjascripts running at the same time, one for EUR/USD and one for USD/CHF. Is this possible?
    If yes, can NT handle about five to six different scripts running at the same time?

    Secondly, when I like to switch to discretionary mode for a particular instrument, can I selectively terminate the script for just that instrument and leave the other scripts still running?

    If running multiple scripts is not possible, is there any viable workaround?

    Appreciate your feedback. Thank you so much.

    #2
    Hi JoeStein, yes to both your questions - to selectively terminate a script please use the start / stop button in the Strategies tab in the Control Center - http://www.ninjatrader-support.com/H...egiesTab1.html

    Comment


      #3
      Thanks so much for your feedback.

      I've a couple of follow-up issues:
      I'm trying to define a user-input in the Strategy Builder to take the Stop price for a currency pair. Forex bid/ask have five decimal places (MBTrading), but the Strategy Builder allows a max of only three decimal places (double) for the user input. Could you please suggest a workaround to accommodate five (or at least four) decimal places?

      Secondly, I'm using a 10min time-frame on the chart and invoking my Strategy from the chart. This way, will the OnBarUpdate() method be called every 10minutes? Or, will it be called every time the price is updated (typically several times in a second)? I would need the method invocation few times every second. This seems obvious, but just wanted to confirm and make sure.

      Appreciate it.

      Comment


        #4
        You're welcome - for the double input, it would just not show more than 3 decimals in the Strategy Wizard inputs page, but actually it can hold values up to 16 digits precision.

        For backtests the OnBarUpdate is called at the close of the bar, in realtime it depends on your CalculateOnBarClose setting, more can be found in this link from our helpguide - http://www.ninjatrader-support.com/H...BarClose1.html

        Comment


          #5
          Thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          608 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          355 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X