I'm trying to enter and exit a position x number of days prior and after a specific date. I have the exit condition working but not the enter. Here's what i have so far.
#region Variables
// Wizard generated variables
private int entD = 1; // Default setting for EntD
private int extD = 1; // Default setting for ExtD
protected override void OnBarUpdate()
{
// Condition set 1
if (ToDay(Time[0]) - EntD == 20091105 )
{
EnterLong(DefaultQuantity, "Ent1");
}
// Condition set 2
if (ToDay(Time[0]) - ExtD > 20091105 )
{
ExitLong("DefaultQuantity", "Ent1");
}
}
Thanks
Comment