Manage orders with dictionary TryGetValue in levels - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Manage orders with dictionary TryGetValue in levels
Started:June 17th, 2012 (05:08 AM) by je951 Views / Replies:643 / 1
Last Reply:June 17th, 2012 (05:08 AM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Manage orders with dictionary TryGetValue in levels

Old June 17th, 2012, 05:08 AM   #1 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES
Posts: 2 since Apr 2011
Thanks: 1 given, 0 received

Manage orders with dictionary TryGetValue in levels

I am working on managing orders on support and resistance levels, using unManaged order in Ninjatrader. In order to be in the front of the queue to get fill, I submit all orders on strategy start up. Then when price move in between 2 levels, orders will be cancelled and added under certain condition.

Can anyone help to correct my code? Thanks in advance!

private IOrder es_0 = null;
private double SRHigh = 0;
private double SRLow = 0;
private double level_0 = 0;
private IOrder shortR1       = null;
private IOrder shortR11      = null;

private void Es_0()
		{es_0 = SubmitOrder(0, OrderAction.Sell, OrderType.Limit, DefaultQuantity, level_0, 0, "", "es_0");}
		private void Es_1()


protected void FindSR() //find top and bottom levels 
				for (int x = 0; x < listSR.Count; x++)
					if (listSR[x] > Close[0])
							SRHigh = listSR[x];
							if (x != 0) SRLow = listSR[x - 1];
					if (listSR[x] > Close[0]) SRLow = 0;
					if (listSR[x] < Close[0]) SRHigh = 0;

public class Orders
			public IOrder Order1 { get; set; }
			public IOrder Order11 { get; set; }
		protected void Dictionary()  //find orders on levels
            Dictionary<double, Orders> dict = new Dictionary<double, Orders>();
            dict.Add(level_0, new Orders { Order1 = es_0, Order11 = ts_0 });
				if (dict.TryGetValue(level_0, out Orders(Order1)))
					shortR1 = Order1;
				if (dict.TryGetValue(level_0, out Orders(Order11)))
					shortR11 = Order11;

Reply With Quote

Old June 17th, 2012, 05:08 AM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Manage orders with dictionary TryGetValue in levels

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Global Dictionary sender and receiver RM99 EasyLanguage Programming 6 December 12th, 2014 11:25 AM
Looking for advice on how to manage order in TWS sharp2be IB Trader Workstation 9 September 9th, 2012 08:27 PM
Global Dictionary Question c12345 EasyLanguage Programming 1 February 24th, 2012 03:05 PM
IMF Says Ireland Can Manage on Its Own Quick Summary News and Current Events 1 November 13th, 2010 11:30 AM
How do you manage & maintain? thinkfuture Traders Hideout 5 April 30th, 2010 08:14 PM

All times are GMT -4. The time now is 01:14 AM.

Copyright © 2016 by 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.
no new posts

Page generated 2016-10-24 in 0.07 seconds with 20 queries on phoenix via your IP