I have a custom indicator. The basic logic is this:
protected override void OnBarUpdate()
{
Trend[0] = 0;
if (Value[0] > Value[1])
Trend[0] = 1;
else if (Value[0] < Value[1])
Trend[0] = -1;
Print(Trend[0]);
}
So in my output box i get either a 1 or -1 every time the bar updates. That all works well. My question is what can I add to the code so that when I call this indicator through the strategy builder I can go long for 1 and short for -1. Or do I have to copy this code and variable into a strategy? See the attached pic for a visual explanation.
Comment