![]() |
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
|
|||||||
| 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 |
|
Member
Join Date: Jun 2012
Posts: 87
Thanks: 3
Thanked 1 time in 1 post
|
I have created a simple strategy that uses Renko bars. The problem is that sometimes my trades are entered exactly where I specified and sometimes they are completely wrong. In history performance everything looks perfect but when testing in reply it's hit and miss. Why is this?
Here's my code: Code:
protected override void Initialize()
{
SetProfitTarget("", CalculationMode.Ticks, ProfitTarget);
SetStopLoss("", CalculationMode.Ticks, StopLoss, false);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (ToTime(Time[0]) > ToTime(8, 30, 0)
&& ToTime(Time[0]) < ToTime(14, 55, 0)
&& Position.MarketPosition == MarketPosition.Flat
&& CrossAbove(DMplus(ADXPeriod).DiPlus, DMplus(ADXPeriod).DiMinus, 1))
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (CrossBelow(DMplus(ADXPeriod).DiMinus, DMplus(ADXPeriod).DiPlus, 1))
{
ExitLong("", "");
}
}
Last edited by relogical; 06-27-2012 at 06:02 PM.
|
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Renko | tonynt | Automated Trading | 8 | 08-25-2011 12:44 PM |
| Renko in 6.5 | shali27 | Charting | 1 | 05-12-2010 09:15 AM |
| Renko Help | kermut | Strategy Analyzer | 5 | 08-15-2009 04:17 PM |
| Connection Problems followed by NT Strategy Problems | GerTrader | Connecting | 21 | 05-20-2009 01:29 PM |
| Log File problems and Live Trade Problems | gygraham | Connecting | 7 | 03-30-2008 05:16 PM |