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

Multi Instrument determine Instrument for entry

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

    Multi Instrument determine Instrument for entry

    I am running one (!) multi-timeframe strategy now with a) JPN225 and JPYUSD and b) HKD33 and HKDUSD. The respective currency depends on the index selected.

    With the latter order entries are executed for the HKDUSD instead of the index instrument. With the JPN225 orders are executed for the index as desired.

    How is this determined when the trigger is GetCurrentAsk(0) for both? And more importantly how can I change that to a reliable execution of orders on the index?

    #2
    Hello P-Sionic,

    Thank you for writing in.

    Just to clarify, when adding multiple series to a strategy, each will have their own index; no two series will have the same index.

    So, for example, if you're running the strategy on a JPN225 chart, and you have added JPYUSD, HKD33, and HKDUSD (in this order in Initialize()), each instrument will have the following indexes:

    JPN225: 0
    JPYUSD: 1
    HKD33: 2
    HKDUSD: 3

    If you would like to refer to a specific instrument with GetCurrentAsk(), you'll use one of the indexes shown above.

    GetCurrentAsk(0) would be referring to the current ask price of JPN225. GetCurrentAsk(1) would be referring to JPYUSD, so on and so forth.

    If you would like to submit an entry to a specific index, you'll want to use the overload of your entry method that asks for a barsInProgressIndex.

    For example, with EnterLong():
    Code:
    // first parameter asks for the barsInProgressIndex, second parameter asks for the
    // quantity, and the last parameter asks for a signal name
    EnterLong(1, 1, "Entry");


    I would highly suggest taking a look at this help guide for further information about working with multiple time-series/multiple instruments in one script: https://ninjatrader.com/support/help...nstruments.htm

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ursavent, Today, 12:54 PM
    0 responses
    2 views
    0 likes
    Last Post ursavent  
    Started by Mizzouman1, Today, 07:35 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by RubenCazorla, Today, 09:07 AM
    2 responses
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by i019945nj, 12-14-2023, 06:41 AM
    7 responses
    82 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by timmbbo, 07-05-2023, 10:21 PM
    4 responses
    158 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X