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

Get Data from an specific intrument into the calculation

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

    Get Data from an specific intrument into the calculation

    Hi, is it possible that I can add a condition from a different instrument ?

    As example :

    When 200 EMA and 50 EMA in XAUUSD Cross = Go Long Trade in EUR/USD (or current instrument where strategy is activated)

    #2
    Yes, you can. See for instance: https://ninjatrader.com/support/help...ghlightsub=add
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello Uregon,

      Thanks for your post.

      As QuantKey_Bruce stated, yes this would be possible to accomplish.

      Add() would be used to add a secondary data series, such as XAUUSD to your script and access values from that added series. See the help guide documentation below for more information.

      Add(): https://ninjatrader.com/support/help....html?add3.htm

      To access EMA values from the added series, you could use something like EMA(BarsArray[1], 200)[0] and EMA(BarsArray[1], 50)[0] where BarsArray[1] is referencing the first added data series in the script for EMA calculations.

      Review this help guide page to gain a good understanding of working with multi-series NinjaScripts and accessing values from added data series: https://ninjatrader.com/support/help...nstruments.htm

      EMA: https://ninjatrader.com/support/help...onential_e.htm
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,404 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      95 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      160 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      9 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X