{ЗДЕСЬ ЗАПОЛНИТЕ УСЛОВИЯ НА ОТКРЫТИЕ И ЗАКРЫТИЕ ПОЗИЦИЙ}
Buy:=Cross(RSI(12),45);
Sell:=Cross(60,RSI(12));
ExitBuy:=Cross(60,RSI(12));
ExitSell:=Cross(RSI(12),45);
FrontBuy.Up:=Ref(OnBuy,-1)=0 AND OnBuy=1;
FrontBuy.Down:=Ref(OnBuy,-1)=1 AND OnBuy=0;
FrontSell.Up:=Ref(OnSell,-1)=0 AND OnSell=1;
FrontSell.Down:=Ref(OnSell,-1)=1 AND OnSell=0;
OnBuyLevel:=Ref(OnBuy,-1)=1 AND OnBuy=1;
OnSellLevel:=Ref(OnSell,-1)=1 AND OnSell=1;
deltBuy:=If(FrontBuy.Up, 0,
If(OnBuyLevel, C-Ref(C,-1),
If(FrontBuy.Down, C-Ref(C,-1), 0)));