I contained two conditions within (IsFirstTickOfBar) and I am sometimes getting the conditions to trigger when the conditions have not fully played out. It seems most of the time I will get a "bar close" behavior but other times the line I have set to cross will fall short of crossing, yet the strategy is executing entries prematurely.
Here's what I have:
if (IsFirstTickOfBar)
{
if (CrossAbove(MACD1.Diff, 0, 1))
{
EnterLong(Convert.ToInt32(Position.Quantity), @"Long Zero");
}
if (CrossAbove(MACD1.Diff, 0, 1))
{
EnterShort(Convert.ToInt32(Position.Quantity), @"Short Zero");
Every now and then the entries will not trigger at all.
Does this sound normal?
Comment