Hi, I need help to create a stop loss.
This is my trade system
// average 21
MME = EMA(Close,21);
Media = MME - Ref(MME,-1);
//average turn up, buy above high +0.01
BuyPrice = ValueWhen(Media > 0 AND Ref(Media,-1) < 0, High+0.01); OK
//average turn donw, sell below low -0.01
SellPrice = ValueWhen(Media < 0 AND Ref(Media,-1) > 0, Low-0.01); OK
//loss = ValueWhen(Media > 0 AND Ref(Media,-1) < 0, Low-0.01);
Its not work, I would like to sell when average turn down(low - 0.01) or when
price cross minimum of buyprice day. In fact, I need two point's sell. I don't
know make it.
// buy and sell
Buy = Cross(High,BuyPrice) & Media > 0; OK
Sell = Cross(SellPrice,Low) & Media < 0; //OR cross (loss, low) - its not
work. Only the first condition work right.
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Thaks for help and sorry for my english.