I want to have the command ToTime in conjunction with a time (for example 9:00). I use it as a variable.
First I set variables:
#region Variables
private int target = 10; // Default setting for Target
private int stop = 10; // Default setting for Stop
private int timeStart = 90000; // Default setting for TimeStart (trading)
private int timeEnd = 100000; // Default setting for TimeEnd
#endregion
protected override void Initialize()
{
SetProfitTarget("", CalculationMode.Ticks, Target);
SetStopLoss("", CalculationMode.Ticks, Stop, false);
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
if (ToTime(Time[0]) > timeStart && ToTime(Time[0]) < timeEnd)
......
}
If I now use the backtest or use the strategy in a chart, I do not get the variables for timeStart and timeEnd in the little window bevor. All I can change, is ProfitTarget and StopLoss.
What mistake I make?
Thanks

Comment