I need Help

ocil

Well-Known Member
#1
Hi I am using below code to exit my trade in intraday. But i am facing small problem After closing my trade at 3.15 I still received new signal after 3.15.
I want no signal after 3.15. Also i have to closed my call on 3.15 is there any way to generate exit call at 3.15 in afl . Thanks for your help.
=====================================
CloseAtEnd = ParamToggle("Close Positions EOD", "No|Yes");
ForceCloseTradesAfter =151500;

NextBarOutsideRTH = ( Ref(TimeNum(), 1) > ForceCloseTradesAfter);

NextBarNotToday = (Ref(DateNum(), 1) > DateNum());

Buy = Cross(j, nw);

Short =Cross(nw, j);

Sell =IIf(CloseAtEnd==True, Short, Short OR NextBarOutsideRTH OR NextBarNotToday);

Cover=IIf(CloseAtEnd==True, Buy, Buy OR NextBarOutsideRTH OR NextBarNotToday);
 
#2
Hi I am using below code to exit my trade in intraday. But i am facing small problem After closing my trade at 3.15 I still received new signal after 3.15.
I want no signal after 3.15. Also i have to closed my call on 3.15 is there any way to generate exit call at 3.15 in afl . Thanks for your help.
=====================================
CloseAtEnd = ParamToggle("Close Positions EOD", "No|Yes");
ForceCloseTradesAfter =151500;

NextBarOutsideRTH = ( Ref(TimeNum(), 1) > ForceCloseTradesAfter);

NextBarNotToday = (Ref(DateNum(), 1) > DateNum());

Buy = Cross(j, nw) AND TimeNum() < 151500;

Short =Cross(nw, j) AND TimeNum() < 151500;

Sell =IIf(CloseAtEnd==True, Short, Short OR NextBarOutsideRTH OR NextBarNotToday);

Cover=IIf(CloseAtEnd==True, Buy, Buy OR NextBarOutsideRTH OR NextBarNotToday);
 

Similar threads