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

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
    BertrandNinjaTrader Customer Service

    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
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by helpwanted, Today, 03:06 AM
          1 response
          10 views
          0 likes
          Last Post sarafuenonly123  
          Started by Brevo, Today, 01:45 AM
          0 responses
          8 views
          0 likes
          Last Post Brevo
          by Brevo
           
          Started by aussugardefender, Today, 01:07 AM
          0 responses
          5 views
          0 likes
          Last Post aussugardefender  
          Started by pvincent, 06-23-2022, 12:53 PM
          14 responses
          242 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          9 responses
          386 views
          1 like
          Last Post Gavini
          by Gavini
           
          Working...
          X