NexusFi: Find Your Edge


Home Menu

 





cancel last order


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one terratec with 8 posts (2 thanks)
    2. looks_two bukkan with 4 posts (3 thanks)
    3. looks_3 lolu with 2 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 6,665 views
    2. thumb_up 8 thanks given
    3. group 4 followers
    1. forum 16 posts
    2. attach_file 1 attachments




 
Search this Thread

cancel last order

  #1 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515

I place orders with an indicator (not in a strategy).To cancel the last order I use a shortcut from the hotkey manager.

I would like to do this with a button in the toolbar that I use to clear pending stuff from the last order. Is there a way to program this command (not the button), or to simulate the shortcut (Ctrl+Alt+Escape) without pushing the keys?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,443 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,607



terratec View Post
I place orders with an indicator (not in a strategy).To cancel the last order I use a shortcut from the hotkey manager.

I would like to do this with a button in the toolbar that I use to clear pending stuff from the last order. Is there a way to program this command (not the button), or to simulate the shortcut (Ctrl+Alt+Escape) without pushing the keys?

Sorry, but I am having some trouble following you. I haven't used Ninja in a long, long time but I am pretty sure I am right:

1. You can't place orders with an indicator, it requires a strategy. Unless you mean you are just trading (discretionary) by clicking buttons.

2. Toolbars are made up of buttons. It is not clear what you mean --- you want a button in the toolbar, but you don't want a button? huh?

You can find a few examples of toolbar code here:


Here is a thread on AutoHotKey:


Yes, it is possible to create a toolbar button to clear a pending order. But only if it is a strategy.

Yes, it is possible to use third party programs like AutoHotKey to issue 'commands' to NinjaTrader through keyboard shortcuts.

If I have misunderstood, please restate the question and hopefully someone else can also help you.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371


terratec View Post
I place orders with an indicator (not in a strategy).To cancel the last order I use a shortcut from the hotkey manager.

I would like to do this with a button in the toolbar that I use to clear pending stuff from the last order. Is there a way to program this command (not the button), or to simulate the shortcut (Ctrl+Alt+Escape) without pushing the keys?

You can send hotkey short cuts using Sendkeys command in a NT indicator. For instance, if your hotkey to cancel the last order is assigned to F8, then use SendKeys.Send("{F8}");

Here's a post where max-td uses the ChartButtons indicator to change the Ninjatader drawing tools with one button click.

Reply With Quote
Thanked by:
  #5 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515


Big Mike View Post
1. You can't place orders with an indicator, it requires a strategy. Unless you mean you are just trading (discretionary) by clicking buttons.

Sorry for being not so clear. English is my third language…
I plan the trade with entry, stop, targets, MM etc. and some programmed limiting choices by the entry part of my trading plan with this tool. And if OK, push the button. I call it discretionary trading with training wheels. And its an indicator.

As you see on the picture, I have an entry order at the exchange that was sent by clicking the button and two oco orders (generated by that clicking) that are in my computer (and will go to the exchange when entry price is touched).
To cancel this stuff I have to cancel the order and the pending orders in my system. And I want to do this with one click at the clear button, to keep things KIS(S).

Attached Thumbnails
Click image for larger version

Name:	tradeyourplan.png
Views:	165
Size:	41.1 KB
ID:	45098  
Started this thread Reply With Quote
  #6 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515


monpere View Post
SendKeys.Send("{F8}");

Thats what I was looking for. Thx! This should work.

Started this thread Reply With Quote
  #7 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515

For Ctrl+Alt+Escape (my Hotkey for "cancel last order"), the code is:
SendKeys.Send("^%{ESC}"); // HotKey for "cancel last order"

And it works. Thx!

Started this thread Reply With Quote
Thanked by:
  #8 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


Big Mike View Post
1. You can't place orders with an indicator, it requires a strategy. Unless you mean you are just trading (discretionary) by clicking buttons.

you can place an order via an indicator.


Reply With Quote
Thanked by:
  #9 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515

Thx bukkan

My indicator is based on your code. Entry, stop, targets, oco. Everything is possible that way. To plan and enter a trade much more flexible (and visible on the chart, while planing) than ATM. After entry you can even use the breakeven position by using the hotkey code to automate this.

One little problem with your indicator (and mine too): When loading (or reload with F5) or changing time frame with charttrader enabled but closed, I have an error:
Error on calling 'OnStartUp' method for indicator 'ChartTraderIndicator': Object reference not set to an instance of an object.
When changing timeframe etc. with charttrader open, then there are no errors. It's a problem I can live with, but if you see a solution...

Thx again for your work!

Started this thread Reply With Quote
  #10 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


hi terratec,
may be its the ChartTraderControl which is not initialized (it has a private constructor) etc. maybe you should bug fix it with try catch. alternative would be placing the buttons on the toolstrip or the chart panel itself.

with the code i just provided an example (for submitting orders via indicators) which can be taken as a reference point.

Reply With Quote




Last Updated on September 1, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts