I wish to set such a condition in my startegy: Current Asking Price is bigger than Session Opening Price (at 9:30).
Below, I attach part of a code, please take a look at that and say what I did wrong.
I compiled this code and strategy works fine, but it triggers despite a condition is NOT done.
protected override void OnBarUpdate()
{
if (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 160000)
{
int opening = GetBar(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 30, 0));
{
if (GetCurrentAsk() > Close[opening]);
{ //do sth
}}}}
Comment