1) private bool entrarlargo = false
private bool entrarcorto = false
and then my conditions and this:
if (Close [0] > entrada) Entrarlargo= true;
if (Entrarlargo == true)EnterLongLimit(entrada);
else if (Close [0] < entrada)Entrarcorto = true;
if (Entrarcorto == true)EnterShortLimit(entrada);
So in this option I just deleted
if (Position.MarketPosition==MarketPosition.Flat) Entrarlargo= false;
if (Position.MarketPosition==MarketPosition.Flat) Entrarcorto= false;
I thought this way I was calling EnterLongLimit/EnterShort every OnBarUpdate to keep it active.
2) private bool entrarlargo = false
private bool entrarcorto = false
and then my conditions and this:
if (Close [0] > entrada) Entrarlargo= true;
if (Entrarlargo == true)EnterLongLimit(entrada);
else if (Close [0] < entrada)Entrarcorto = true;
if (Entrarcorto == true)EnterShortLimit(entrada);
if (Position.MarketPosition==MarketPosition.Long) EntrarCorto= false;
if (Position.MarketPosition==MarketPosition.Short) EntrarLargo= false;
I again thought this way I was calling EnterLongLimit/EnterShort every OnBarUpdate to keep it active.
But none of the options are good.
Am I in the right direction?
Thank you
Comment