I have a send mail command in onbarupdate that i've intended to send one email each hour but it's sending two pretty much at the same time. I've also noticed my counts are double the amount of bars that have passed.
Thanks for your help!
protected override void Initialize()
{
CalculateOnBarClose = true;
BarsRequired = 45;
ClearOutputWindow();
Add(PeriodType.Minute, 3);
SetProfitTarget(35 * quantity);
}
protected override void OnBarUpdate()
{
CalculateHandL();
if(longPosition > 0)longPosition++;
if(shortPosition > 0) shortPosition++;
//Check buy or sell
if (longPosition >= 1) CheckLongClose();
else if (longPosition == 0 && shortPosition == 0) CheckLongOpen();
if (shortPosition >= 1) CheckShortClose();
else if (longPosition == 0 && shortPosition == 0) CheckShortOpen();
//Update Performance
if (ToTime(Time[0]) % 10000 == 0 )
{
SendMail("removed for post");
}
}
Comment