NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 02-14-2008, 08:23 AM   #1
latkinso
Senior Member
 
Join Date: May 2006
Location: , ,
Posts: 155
Thanks: 0
Thanked 0 times in 0 posts
Default Strategy executes differntly backtest vs live

Hi from Oklahoma

A strategy that performs correctly in backtest is
not executing correctly in realtime.

Could there be a simple explanation for this?

Thanks

Lynn
latkinso is offline  
Reply With Quote
Old 02-14-2008, 08:27 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

This link may provide some guidance.

http://www.ninjatrader-support.com/H...sBacktest.html
NinjaTrader_Ray is offline  
Reply With Quote
Old 02-14-2008, 09:00 AM   #3
latkinso
Senior Member
 
Join Date: May 2006
Location: , ,
Posts: 155
Thanks: 0
Thanked 0 times in 0 posts
Default Strategy Execution

Hi Ray

It is not the difference in fills, it is difference in quantity
Strategy is designed to execute Long 1a, long 1b, and
long 1c, and take them off at various tgts.

Sim execution on live data only executes 1 lot.

A bit strange

Lynn
latkinso is offline  
Reply With Quote
Old 02-14-2008, 10:39 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Have you hardcoded in the quantity to be traded or are you using DefaultQuantity? I believe this setting is modifiable when you are starting the strategy.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-18-2008, 04:55 AM   #5
justmake
Junior Member
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default Strategy executes differntly backtest vs live

Hello,

I also encounter the same problem with a double down strategy.In the strategy, I double my positions when price drops furthur from the first entry..etc.

In backtesting, the results looks normal. , Sell order Qty=Buy order Qty

But when I test in real-time, the is an error in quantity of order.(see screenshot), Sell order changes when the last Sell order was placed.

any answer for this difference in backtest and live?
Last edited by justmake; 05-19-2008 at 02:21 AM.
justmake is offline  
Reply With Quote
Old 05-18-2008, 12:45 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

You will need to debug your strategy with TraceOrders to see what it is doing. From what I can tell I am guessing you may be amending your order which is why it is increasing like that. Another possible area to investigate would be how your two long orders went through and if it has any impact on your exit orders.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-19-2008, 04:09 AM   #7
justmake
Junior Member
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default Strategy executes differntly backtest vs live

Hello,Josh,

After seeing Output window, I do see "Amending matching order:Action..."
in the output which changes the orginal Sell limit order to Wrong QTY.

Because this problem didn't happen in backtesting, how should I solve this problem? Should I change the method for placing the Sell limit order?

thanks.
Attached Images
File Type: gif live-order1.png (73.3 KB, 13 views)
justmake is offline  
Reply With Quote
Old 05-19-2008, 07:13 AM   #8
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

For clarification -

Is this a sell order that was triggered by SetProfitTarget() ?
NinjaTrader_Ray is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strategy to backtest Woodies CCI trades LG Strategy Development 7 04-23-2013 10:02 AM
Same strategy run on several instruments live ohowie Suggestions And Feedback 1 01-28-2008 09:48 PM
Strategy won't backtest... maxpi Strategy Analyzer 3 11-29-2007 08:09 AM
Strategy Variables not Updating in Backtest Mode dgregor5 Strategy Analyzer 2 07-31-2007 02:50 PM
live (sim) versus backtest ceesvh Strategy Analyzer 4 07-04-2007 12:18 PM


All times are GMT -6. The time now is 12:40 AM.