![]() |
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
Hi! Can anybody help me? I have some problem with my strategy.
When I run it on the market replay it works well (100-150 orders per day). But if I start it on the sim account there are only few very rare orders during the day. I use GetCurrentAsk and GetCurrentBid into my algorithm. No matter if I use: - calculate on close bar or false. - time frame: ticks or range. - delays: from 0 to 150. - slippage: from 0 to 10 - market or limit orders. For example, if I run my strategy on market replay with slippage 5 and using market or limit orders it works well. But if I run it on sim account with slippage 0, delays 0 (perfect conditions) It generates only few orders. How to improve the strategy? I think that the using ask=bid for calculating signals can help (look like market replay). Can I code it? Please turn me in the right direction into my searches. Best regards, Alex
Last edited by Alexpl; 08-10-2012 at 04:49 AM.
|
|
|
|
|
|
#2 | |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Alexpl,
Welcome to the forum and I am happy to assist you. You can use slippage in backtest only. Not while running your strategy live or in market replay. Quote:
To assist you further may I know are you trying to backtest it or running the strategy in market replay or live. I look forward to assisting you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
Thanks for reply.
Slippage it's not a problem. I run strategy on market replay (get 100-150 orders per day) and live sim account (get 0-5 orders per day) Why is so big difference in the number of the orders and how to improve it? This is make a big influence to results.
Last edited by Alexpl; 08-10-2012 at 05:06 AM.
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Alexpl,
If there is data discrepancy then your straegy can work differently. Can you please make sure the live data and the replay data matches with each other. Also please append the code TraceOrders = true in the initialize section of the strategy and see if you are witnessing any cancelled/rejected orders. http://www.ninjatrader.com/support/h...raceorders.htm Also is the strategy a multi-series strategy? I look forward to assisting you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
Hi! My data feed is Kinetick. I am not sure that then I uses range bars they builds identicaly. There are not mutch enought orders in the trace log then I uses real sim account. Some orders are rejected but it's Ok.(Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties')
Strategy is not a multi-series. For example: I had 6 trades on live account today. Then I tested the same period on market replay I had 12 trades. 4 range; GC 12-12; On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=True CancelExitOrdersOnDisable=True CalculateOnBarClose=True MaxRestarts=10 in 5 minutes
Last edited by Alexpl; 08-21-2012 at 10:54 AM.
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
Maybe it can help
http://imageshack.us/photo/my-images...ge8212012.jpg/ The smooth part of the chart - on the starting "new chart" .When new data coming it displayed more accurately (from 14:05). But this does not affect the strategy. Maybe my strategy still use incorrect data (like the first part of picture)
Last edited by Alexpl; 08-21-2012 at 10:52 AM.
|
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Alexpl,
The orders are getting rejected due the entry handling rules. Please make sure the strategy parameters are the same. Also please make sure the rollover date for GC 12-12 is set to July 30.
Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Joydeep for this post: |
|
|
|
#8 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
Thanks, NinjaTrader_Joydeep! I have corrected rollover date and run strategy again. Charts are correct now.
Last edited by Alexpl; 08-21-2012 at 01:50 PM.
|
|
|
|
|
The following user says thank you to Alexpl for this post: |
|
|
|
#9 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Alexpl,
Thanks for your note. Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
Hi, NinjaTrader_Joydeep! I have tested my strategy with the same conditions on real sim and market replay today. Results are absolutly different. I can provide you with reports.
Different entries in different time. Please, help me. I am searching for reason during last few months. |
|
|
|
|
|
#11 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Alexpl,
Can you confirm the data while trading live and in the market replay matches with each other. If you test the SampleMACrossover strategy that comes with NinjaTrader then can you get the same results? I look forward to assisting you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
These screens are from my NT:
Live and replay at the same time. They are identical. May I use another way to compare? I am also starting SampleMACrossover strategy for comparison. Thanks.
Last edited by Alexpl; 08-23-2012 at 05:03 AM.
|
|
|
|
|
|
#13 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Alexpl,
Please append the below code in the initialze section of your code and see if any orders are getting rejected or not. Code:
TraceOrders = true;
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Aug 2012
Posts: 29
Thanks: 8
Thanked 1 time in 1 post
|
Hello, NinjaTrader Joydeep
When I have tested SampleMACrossover I got identical results. Only one trade was closed 2 ticks above than the same in replay. (18 orders were compared). I think It's Ok. And another question: does the orders can be rejected before they will filled without tracing into logs? (for example: condition is valid during only one tick) Thanks, NinjaTrader Joydeep, for all answers, they are very helpful !
Last edited by Alexpl; 08-30-2012 at 02:05 PM.
|
|
|
|
|
|
#15 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,860
Thanks: 162
Thanked 579 times in 570 posts
|
Alexpl,
Any rejections should be logged.
Matthew
NinjaTrader Customer Service |
|
|
|
![]() |
| Tags |
| getcurrentask, getcurrentbid, oredrs |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why cannot reverse Entry orders execute on the same bar as exit orders? | koganam | Miscellaneous Support | 10 | 04-11-2011 02:48 PM |
| Unmanaged Sell Limit orders not appearing in Orders window | AlgoNaute | Automated Trading | 9 | 04-05-2011 06:53 AM |
| Holding orders in strategy somehow when waiting for fills & cancels (managed orders) | adamus | General Programming | 5 | 10-12-2010 05:02 AM |
| Control Panel Orders shows no Order when an Orders must have occurred? | mtthwbrnd | Strategy Analyzer | 4 | 02-10-2010 09:10 AM |
| Limit orders - book position kept when new orders are generated | Fabrice | Automated Trading | 6 | 10-13-2007 03:16 PM |