Hi Community!

Greetings!

I'm encountering an issue with my trading strategy where I'm receiving a Long Trade Signal even when a Short trade is already in progress, and vice versa.

The primary challenge is ensuring that the strategy generates the appropriate signals based on the existing trade status. I'm seeking assistance in refining the logic to prevent conflicting signals and enhance the overall performance of the strategy.

``````newday = Day() != Ref(Day(),-1);

Buy =  ( (Ref(BC, -1) AND HaClose > ValueWhen(BC, HaOpen) ) OR ( B1 ) ) AND TradesOpenTime ;

Short = ( (Ref( SC, -1 ) AND HaClose < ValueWhen( SC, HaOpen ) ) OR ( S1 ) ) AND TradesOpenTime ;
Short = Ref(Short,-1);

Short = ExRem(Short, iCover);
iCover = ExRem(iCover, Short);

ShortPrice = Valuewhen(Short, Open);

ShortStop = ShortPrice + stops;
ShortTarget = ShortPrice - target;

cover = icover OR Cross(H, Shortstop) OR ValueWhen(C, H >= ShortStop) OR Cross(ShortTarget, L) OR ValueWhen(C, L <= ShortTarget);

Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);

CoverPrice = ValueWhen( Cover, IIf( Cross( ShortTarget, L ) OR ValueWhen( C, L <= ShortTarget ), ShortTarget, IIf( Cross( H, Shortstop ) OR ValueWhen( C, H >= ShortStop),Shortstop ,Open ) ) );

Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);
``````

I'm facing a second issue with my strategy. Despite observing multiple instances where Long and Short conditions are met within a day, my strategy seems to consider only two trades per day—specifically, one Long and one Short.

This occurs even when I include or exclude the Trade Limit code.

While I've plotted all bars where the conditions are met, the strategy is only taking into account a total of two trades daily, restricting it to one Long and one Short, and not allowing for variations such as multiple Longs or multiple Shorts on the same day.

I'm seeking assistance in understanding and resolving this limitation.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.