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 TraderG23, 12-08-2023, 07:56 AM
    9 responses
    382 views
    0 likes
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    1 view
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Yesterday, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Working...
    X