Problem with Order Overfills with NinjaTrader. What about Multicharts? - futures io
futures io



Problem with Order Overfills with NinjaTrader. What about Multicharts?


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one mattz with 3 posts (0 thanks)
    2. looks_two lawtan with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (1 thanks)
    1. trending_up 4,655 views
    2. thumb_up 2 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Problem with Order Overfills with NinjaTrader. What about Multicharts?

(login for full post details)
  #1 (permalink)
 lawtan 
Singapore
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
 
Posts: 6 since Apr 2010
Thanks: 0 given, 0 received

I have been writing strategies and testing them on NinjaTrader for several months, and once I activate them with live account, I got "order overfill" problem. I implement 1 stop order, and 1 exit order my strategy and do not see anyway to simplify my strategy anymore. I have implemented the Stop order in the OnExecution rountine instead, and still the problem exists. After several correspondances with the Technical Support, there is no clear way to define how it occurs. Most of the time, I do not face this problem in simulation mode, but once the strategy goes live, this problem occurs, and usually it places the order abruptly in the wrong direction, causing me losses in the errorneous trade.
1. I wonder if there is any good way to avoid this problem in NinjaTrader script.
2. Perhaps it is the platform problem. I would also like to explore other more stable and robust trading platforms that I can rely on for live trading e.g, Multicharts recommended by Big Mike. I wonder if this type of "order overfill" problem can be better managed and avoided. Any comments will be appreciated.

Started this thread Reply With Quote

Journal Challenge April 2021 results:
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(620 thanks from 61 posts)
looks_twoSalao's Journalby Salao
(163 thanks from 29 posts)
looks_3Learning to Profit - A journey in algorithms and optionsby Syntax
(115 thanks from 27 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(94 thanks from 30 posts)
looks_5Maybe a little bit different journalby Malykubo
(53 thanks from 32 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
I finally blew up an account
124 thanks
The Crude Dude Oil Trading System
85 thanks
Spoo-nalysis ES e-mini futures S&P 500
65 thanks
The tiyfTradePlanFactory indicator
31 thanks
Building a Crypto Mining Rig
19 thanks
 
(login for full post details)
  #3 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,494 received



lawtan View Post
I have been writing strategies and testing them on NinjaTrader for several months, and once I activate them with live account, I got "order overfill" problem. I implement 1 stop order, and 1 exit order my strategy and do not see anyway to simplify my strategy anymore. I have implemented the Stop order in the OnExecution rountine instead, and still the problem exists. After several correspondances with the Technical Support, there is no clear way to define how it occurs. Most of the time, I do not face this problem in simulation mode, but once the strategy goes live, this problem occurs, and usually it places the order abruptly in the wrong direction, causing me losses in the errorneous trade.
1. I wonder if there is any good way to avoid this problem in NinjaTrader script.
2. Perhaps it is the platform problem. I would also like to explore other more stable and robust trading platforms that I can rely on for live trading e.g, Multicharts recommended by Big Mike. I wonder if this type of "order overfill" problem can be better managed and avoided. Any comments will be appreciated.

MultiCharts gives you a lot more control and flexibility than NinjaTrader with automated order execution.

- You can tell it if it should get the quote data from the broker, or from your data feed.
- You can tell it if it should recalculate based on events like order filled or market position change.
- You can tell it to run in sync or async mode, meaning entries/exits are based on what the broker is reporting your position as, or what MultiCharts reports internally.
- Each strategy you run can be told to execute at a different broker, its controllable per-strategy, just like you can control the chart per-datasource.

I suggest you get the trial of MultiCharts and see for yourself. Here is just one excerpt from the on-line help:


Quoting 

Synchronization of the Market Position in the Auto trading Mode

In auto-trading, there are certain circumstances which may cause the actual position and the position shown on the chart to be different. MultiCharts gives the user the ability to set the initial position of the strategy so that the actual position and the position on the chart will be synchronized.
For example, a strategy has long and short orders. The buy order reverses the short position, and the short order reverses the long position. If the position is long 1 contract, then the strategy will sell 2 contracts to reverse the long position. Conversely, if the position is short 1 contract, then the strategy will buy 2 contracts to reverse the short position. The strategy is always either long 1 contract or short 1 contract. The problem arises when this strategy is initially turned on. When this strategy is initially turned on, the actual position is flat. However, the chart will show, for example, that the strategy is already long 1 contract. When the short signal fires, the strategy will think that it already has a long position and therefore short 2 contracts to reverse the long position. This means the actual position is short 2 contracts instead of short 1 contract. Yet the chart shows that the strategy is only short 1 contract, and the actual position should only be short 1 contract.

MultiCharts can prevent such problems from occurring. Before turning on auto-trading, the user can specify the actual position and MultiCharts will understand how to synchronize it with the strategy. In the example above, the user can specify that the actual position is flat. When the short signal fires, MultiCharts will only short 1 contract instead of 2 contracts. The actual position is now synchronized with the chart, and the actual position is correct. Both the actual position and chart position are short 1 contract.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #4 (permalink)
 mattz   is a Vendor
 
 
mattz's Avatar
 
Posts: 2,489 since Sep 2010
Thanks: 2,429 given, 3,764 received

I want to attempt and help you with that.
Can you give a specific example of what the strategy was suppose to do and what it did instead.

Trading futures and options involves substantial risk of loss and is not suitable for all investors. Past performance is not necessarily indicative of future results. You may lose more than your initial investment. All posts are opinions and do not claim to be facts. Please conduct your own due diligence. Use only Risk capital when trading Futures.
1 800 771 6748 local 561 367 8686 email support@OptimusFutures.com
Reply With Quote
 
(login for full post details)
  #5 (permalink)
 mattz   is a Vendor
 
 
mattz's Avatar
 
Posts: 2,489 since Sep 2010
Thanks: 2,429 given, 3,764 received

From the little research I have done:


If your strategy is working in sim mode, but not in live as expected, you will most likely need to de-bug your strategy order placement method and take an unmanaged order method approach. You can self manage the orders meaning the strategy is not terminated. The Unmanaged approach should only be taken if you are a very experienced programmer based on the risks involved. However, the upside is the Unmanaged approach offers ultimate flexibility in terms of NinjaTrader order submission and management. I would suggest reviewing the NT 7 help guide that covers 'overfills' when taking an Unmanaged approach.


I would suggest also to resend the traces/logs to NT again. If you do, I will give them a push to answer your email.

Let me know if you do.

Trading futures and options involves substantial risk of loss and is not suitable for all investors. Past performance is not necessarily indicative of future results. You may lose more than your initial investment. All posts are opinions and do not claim to be facts. Please conduct your own due diligence. Use only Risk capital when trading Futures.
1 800 771 6748 local 561 367 8686 email support@OptimusFutures.com
Reply With Quote
 
(login for full post details)
  #6 (permalink)
 lawtan 
Singapore
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
 
Posts: 6 since Apr 2010
Thanks: 0 given, 0 received

Thanks Big Mike for your reply. Will try out Multicharts soon.

Mattz, my NinjaTrader strategy has the following functions;
1. Go long upon Long Signal
2. Place Stop Loss order in Iexecution
3. Exit long if Long Signal condition no longer exist or profit target is reached
The opposite is true for Go Short.

The Order Overfill occurs occasionally when a Long ord Short order is placed.

Here is an extract of the code:


Quoting 
protectedoverridevoid Initialize()
{


Add(PeriodType.Tick, tickMT);
Add(PeriodType.Tick, tickLT);
Add(PeriodType.Minute,
13);



EntriesPerDirection =
1;
EntryHandling = EntryHandling.AllEntries;
TimeInForce = Cbi.TimeInForce.Day;

CalculateOnBarClose =
true;
}


privatevoid GoLong()
{ entryOrder = EnterLongLimit(
0, true, orderQty, GetCurrentBid(), "SMTsqt_L"); }


privatevoid CoverLong()
{ exitOrder = ExitLong(
"Exit SMTsqt_L", "SMTsqt_L"); }


privatevoid GoShort()
{ entryOrder = EnterShortLimit(
0, true, orderQty, GetCurrentAsk(), "SMTsqt_S"); }


privatevoid CoverShort()
{ exitOrder = ExitShort(
"Exit SMTsqt_S", "SMTsqt_S");}


protectedoverridevoid OnBarUpdate()
{

if (BarsInProgress == 0)
{ Compute something }


if (BarsInProgress == 1)
{ Compute something and place orders
if (exitOrder == null && Position.MarketPosition == MarketPosition.Long)
{
if xxxx CoverLong() // Profit Target
elseif xxxxCoverLong() // Long Signal no longer exist
}

elseif (exitOrder == null && Position.MarketPosition == MarketPosition.Short)
{
if xxxx
CoverShort() // Profit Target
elseif xxxx CoverShort(); // Short Signal no longer exist
}
elseif (entryOrder == null && Position.MarketPosition == MarketPosition.Flat)
{
if (longcondition) GoLong();
else if (shortcondition) GoShort();

}
}



if (BarsInProgress == 2)
{ Compute something }

protectedoverridevoid OnOrderUpdate(IOrder order)
{
if (entryOrder != null && entryOrder.Token == order.Token)
{ if (order.OrderState == OrderState.Cancelled && order.Filled == 0)
{entryOrder =
null;}
}
}


protectedoverridevoid OnExecution(IExecution execution)
{
if (entryOrder != null && entryOrder.Token == execution.Order.Token)
{
if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
{
if (execution.MarketPosition == MarketPosition.Long)
{
stopOrder = ExitLongStop(0, true, execution.Order.Filled, execution.Order.AvgFillPrice - tickStop * TickSize, "Stop SMTsqt_L" , "SMTsqt_L"); }

elseif (execution.MarketPosition == MarketPosition.Short)
{
stopOrder = ExitShortStop(0, true, execution.Order.Filled, execution.Order.AvgFillPrice + tickStop * TickSize, "Stop SMTsqt_S" , "SMTsqt_S");

}


if (execution.Order.OrderState != OrderState.PartFilled)
{
if ((stopOrder != null && stopOrder.Token == execution.Order.Token) || (exitOrder != null && exitOrder.Token == execution.Order.Token))
{
if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled)
{
stopOrder = null; exitOrder = null;

}
}



Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
 mattz   is a Vendor
 
 
mattz's Avatar
 
Posts: 2,489 since Sep 2010
Thanks: 2,429 given, 3,764 received

I am only assuming, but this could be the case of inflight execution.
Submitting multiple order both long and short very close to the market, then its possible to have the order executed in the reverse side of the market. I have also seen it with programmed OCO orders.

If you PM me I will send you to our programmer who is really good, he could be of help as well.

Trading futures and options involves substantial risk of loss and is not suitable for all investors. Past performance is not necessarily indicative of future results. You may lose more than your initial investment. All posts are opinions and do not claim to be facts. Please conduct your own due diligence. Use only Risk capital when trading Futures.
1 800 771 6748 local 561 367 8686 email support@OptimusFutures.com
Reply With Quote
 
(login for full post details)
  #8 (permalink)
 MultiCharts 
Columbus, Ohio, US
 
Experience: Intermediate
Platform: MultiCharts
Broker: Multiple/Multiple
Trading: ES, EUR/USD
 
MultiCharts's Avatar
 
Posts: 168 since Oct 2010
Thanks: 74 given, 171 received

If you guys have any questions, please send me a PM.

MultiCharts - Raising the Trading Standard.
Please send me a private message if you have any further questions about MultiCharts
Follow me on Twitter Reply With Quote
The following user says Thank You to MultiCharts for this post:


futures io Trading Community Platforms and Indicators MultiCharts > Problem with Order Overfills with NinjaTrader. What about Multicharts?


Last Updated on October 5, 2010


Upcoming Webinars and Events

NinjaTrader Indicator Challenge!

Ongoing

Journal Challenge w/$1,800 in prizes!

May 7

The Cold Hard Truth: Maybe I Am Not Good Enough w/Chris Gray @ Earn2Trade

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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