BuyMktSellMktHotkeys

This Indicator is a 1st modification of the ClickLimitOrderIndicatorExpanded from NinjaTrader_Jim previous share
https://ninjatrader.com/support/foru...78#post1137778

Combined with the 2nd PreviewKeyTest share
https://ninjatrader.com/support/foru...78#post1137778

The script executes BuyMkt and SellMkt orders with the Numpad7 and Numpad8 Hotkeys keystrokes.

A BuyMkt order is submitted when pressing the Numpad 7 key (while the mouse cursor is over the Chart Window and the Chart window is selected/active).
A SellMkt order is submitted when pressing the Numpad 8 key (while cursor is over the Chart Window and the Chart window is selected/active).

Just simply import the indicator: Control Center > Tools > Import > NinjaScript Add-On > locate "BuyMktSellMktHotkeys.zip"
Then load it on your chart: Right Click > Indicator or Ctrl+I > Available pane > Select "BuyMktSellMktHotkeys"
Then activate the numeric pad (press the Num Lock key)
Then press numpad7 key to enter a Market Long trade order, then press the numpad8 Key to close your long trade with a Market Sell order. Vice Versa for Short and Buy to cover trades.

Note about the size:

You can customize the size of your trades by hardcoding them in the script.
To change the size of your BuyMkt Order hotkey, simply change the number 1 in bold at line 125 in the script to whatever size of your choice:

buyMktOrder = myAccount.CreateOrder(Instrument, OrderAction.Buy, OrderType.Market, OrderEntry.Manual, TimeInForce.Day, 1, 0, 0, "", "buyMktOrder"+DateTime.Now.ToString(), DateTime.MaxValue, null);

Similarly, to change the size of your SellMkt Order hotkey, simply change the number 1 in bold at line 138 in the script to whatever size of your choice:

sellMktOrder = myAccount.CreateOrder(Instrument, OrderAction.Sell, OrderType.Market, OrderEntry.Manual, TimeInForce.Day, 1, 0, 0, "", "sellMktOrder"+DateTime.Now.ToString(), DateTime.MaxValue, null);

Created By PaulMohn
NinjaTrader Version 8
File Size 2.0 KB
Create Date 02/14/2022
# of Downloads 278

Importing to NinjaTrader 8 is Easy!

To import your 3rd party app or add-on to NinjaTrader, simply follow these 3 steps:

  1. Download the app or add-on file to your desktop
  2. From the NinjaTrader Control Center window, select the menu Tools > Import > NinjaScript Add-On…
  3. Select the downloaded file from your desktop

Questions?

Visit the NinjaScript File Sharing discussion in the NinjaTrader user forum to interact with fellow traders and the NinjaTrader support team.