![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: May 2006
Location: , ,
Posts: 155
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: May 2006
Location: , ,
Posts: 155
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#8 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
For clarification -
Is this a sell order that was triggered by SetProfitTarget() ?
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |