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

hot key - simultaneous orders in different instruments (hedge)

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

    hot key - simultaneous orders in different instruments (hedge)

    Hi, is it possible to program a hotkey to buy one instrument and sell another simultaneously? I can't seem to find any mention here or in the help area.
    thanks,
    David

    #2
    Hello trader3000a,

    From the default hotkeys that would not be an option but you could make a NinjaScript addon that does that. A Strategy could be used for that by adding a secondary series and then incorporating some key handing logic for your key press.

    You can find an example of handing key events in the following post, that would be required before doing anything keyboard related to handle the keys you wanted so the chart instrument selector does not appear. https://ninjatrader.com/support/foru...973#post685973

    The platform is made with WPF so you can search online for "WPF detect hotkeys" for some examples of detecting keyboard combinations. In NinjaTrader the shift key cannot be used as a modifier key. https://ninjatrader.com/support/foru...22#post1072722

    As the action of the key event you could submit orders to both instruments.

    You can find an example of sending orders in a strategy based on a WPF button event which could be similar to how you may want to submit orders for the key event. https://ninjatraderecosystem.com/use...bar-buttons-2/





    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kempotrader, Today, 08:56 AM
    0 responses
    6 views
    0 likes
    Last Post kempotrader  
    Started by kempotrader, Today, 08:54 AM
    0 responses
    4 views
    0 likes
    Last Post kempotrader  
    Started by mmenigma, Today, 08:54 AM
    0 responses
    2 views
    0 likes
    Last Post mmenigma  
    Started by halgo_boulder, Today, 08:44 AM
    0 responses
    1 view
    0 likes
    Last Post halgo_boulder  
    Started by drewski1980, Today, 08:24 AM
    0 responses
    3 views
    0 likes
    Last Post drewski1980  
    Working...
    X