I created a basic strategy using the wizard, then unlocked the code to make some tweaks. Now, when I run bactest all the trades get linked with each other (one trade begins where another ends) so visually they look like a curve in the strategy analizer/chart.
Can you please advise where is this coming from/why that happens?
Variables:
// Wizard generated variables
private int lookBack = 20; // Default setting for LookBack
private double profit_Target = 0.1; // Default setting for Profit_Target
private double stop_Loss = 0.06; // Default setting for Stop_Loss
// User defined variables (add any user defined variables below)
protected override void Initialize()
{
SetProfitTarget("", CalculationMode.Percent, Profit_Target);
SetStopLoss("", CalculationMode.Percent, Stop_Loss, false);
CalculateOnBarClose = true;
}
#region Properties
[Description("")]
[GridCategory("Parameters")]
public int LookBack
{
get { return lookBack; }
set { lookBack = Math.Max(20, value); }
}
[Description("")]
[GridCategory("Parameters")]
public double Profit_Target
{
get { return profit_Target; }
set { profit_Target = Math.Max(0.00, value); }
}
[Description("")]
[GridCategory("Parameters")]
public double Stop_Loss
{
get { return stop_Loss; }
set { stop_Loss = Math.Max(0.00, value); }
}
#endregion

Comment