I have Broken the code down to as simple as possible
" protected override void OnBarUpdate()
{
if (Close[0] > Close[5])
{
EnterLong();
}
if (BarsSinceEntry() > 5 )
{
ExitLong();
}
}"
Why does the code not exit after 5 bars every time? Its erratic at best, sometimes 1 bar, sometimes 3, sometimes 5, sometimes more. I dont understand what is wrong here or if am mis interpreting how this function works. In MC it was simple, if BSE > 2 bars, an exit would happen 2 bars later every time.
Comment