How to have a variable that i can declare once and use it

#1
StaticVarSet("a",5);
temp = StaticVarGet("a" );
Buy=GetRTData("Last")<1500;
if(temp==5){
st=BuyPrice+10;
StaticVarSet("a",6);
}
Last=GetRTData("Last");
Sell=Last>st;
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
shape=Buy*shapeUpArrow+Sell*shapeDownArrow ;
Plot(BuyPrice,"buying price",colorRed,styleLine|styleThick);
Plot(st,"stoploss price",colorBlack,styleLine|styleThick);
PlotShapes(shape,colorBlue);
PlotShapes(shape,colorRed);


in this code my stoploss change according to every buy sigle
 

Similar threads