How to use "apply Stop" with the method "Exrem" in the Amibroker?

#1
Hello,

I would like some help from you. I'm developing a system of "Trading" in "intraday". I do not want to make an entry after an exit, in the same bar. I would only enter in the next bar, if at all.

A friend suggested I use "Exrem", also i do not know how to use this method in conjunction with applyStop. Here's my code: (Sorry for my English)

SupC = Optimize ("SupC",2,2,8,2);
infC= Optimize ("InfC",8,2,8,2);
SupV = Optimize ("SupV",8,2,8,2);
infV= Optimize ("InfV",2,2,8,2);
Alvo= Optimize( "Alvo", 50, 50, 100, 20 );

Buy = H > Ref(HHV(H,SupC),-1);
BuyPrice = Ref(HHV(H,SupC),-1);
Sell = L < Ref(LLV(L,infC),-1);
SellPrice = Ref(LLV(L,infC),-1);

Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );

Short = L < Ref(LLV(L,infV),-1);
ShortPrice = Ref(LLV(L,infV),-1);
Cover = H > Ref(HHV(H,SupV),-1);
CoverPrice = Ref(HHV(H,SupV),-1);

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

ApplyStop(stopTypeProfit, stopModePoint, Alvo, 1, False, 0)
 

Similar threads