NinjaTrader Strategies - Mechanical Trading General Discussions - Ask general questions, post charts and videos - backtesting, optmisation and strategy anlyasis
21/04/2010 14:53:59
 Tom Leeson Administrator Posts: 661
|
Trading Validation Session Time Session Limits Strategy runs on a bar close basis. The signals are taken on a bar close basis Profit is calculated on each order action by NT Trade entry Validation occurs on bar close and now pre order submission – Where a market order SAR was placed – I have split the order so I can let the exit occur and then validate again before the entry is submitted to broker. Validation can only occur in the order lifecycle – on or onBarUpdate Impact of onBarClose or orderUpdate Validation It is possible to have a limit set of 100 - and the realized + unrealized profit profit to be > 100 but that wont be processed until the onbarclose or the next onOrderupdate So it is possible on bar close that the profit is 20 and so the session continues. It also works for trades that a re loosers that become profitable. So in the end it balances out – compared to acting on every tick. Customisation options Process on Tick Process on bar close is the strategy method – on tick is not in scope of any easy changes. Each tick would call the validation procedures intrabar – and if need be close and lock sessions Each first tick would process signals – but would look backwards to the previous bar close[-1] instead of close[0] This calls for extensive rework and alos testing with other indicators Windows Timer place a timer in the code which wont work for backtesting and historical – Timer will be disabled for historical data. This will call the validation procedures intrabar – and if need be close and lock sessions Easy but only works for realtime
onMarketData Place a call to onMarketData – again this will act in a different manner realtime to historical. There will more events intrabar realtime and maybe only 1 per bar historical. This will call the validation procedures intrabar – and if need be close and lock sessions Easy but realtime and historic may not be the same behaviours Summary Windows Timer and Market Data realtime changes only – this may not work the same in backtesting or historical – but is east to implement. For onTick bar close – extensive rework and testing is required is complex and requires feasibility study based on unknown indicator integration impact. Current Situation For now I have implemented onbarclose add preorder – which means realized + unrealized profit is only validated - so sometimes you will have a trade on that breaches the limit intra-bar but is not closed and session locked….
-- MicroTrends tom
|
|
0
• permalink
|
Powered by AspNetForum 7.0.1.0
© 2006-2011 Jitbit Software