Hello. I need some help concerning the applystop.
I have read the documents but I don`t find it .
Buy at the open of the next day and close the same day. If the market falls on this day 20 Points from the open stop will trigger. In my code the stoploss is not working. Can someone help me out here.
// I would like to buy at the open on the next day if Buycondition
// and sell at the close. Stoploss 20 Point
//Problem the stoploss is NOT working I have set the Applystop at 1
// I am using daily data EOD
SetOption( "AllowSameBarExit", true);
SetOption("ActivateStopsImmediately", True );
SetOption("FuturesMode", True );
PointValue = 5;
SetOption( "initialequity", 30000 );
SetOption("accountmargin",10);
SetPositionSize( 1, spsShares );
SetTradeDelays(1,1,1,1);
days = LLV( L, 20 );
//timestop
Days_Stop = 0;
ApplyStop(stopTypeNBar, stopModeBars, Days_Stop, 1, volatile = False, ReEntryDelay = 0, ValidFrom = 0, ValidTo = -1, ActivationFloor = 0 ) ;
// stoploss 20 Points
ApplyStop(stopTypeloss,stopModePoint,20,1,False,0); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Setup = Cross( H, Ref( days, -1 ) );
Buy_setup = Setup;
BuyPrice = Open;
SellPrice = Close;
Buy = Buy_setup;
Sell = 0;