Hello World! please help
I am very much unaware of coding just trying to learn.
I have a high and low, I want to place buy order 2,3,5 points above the High and 2,3,5 points below the low for sell, want to change the desired numbers from parameters as when required.
Now if the BUY is triggered want to place a stop loss order 2,3,5 points as desired below the buy price. And if SELL is triggered want to place a stop loss 2,3,5 points above the sell order.
Also want to do the the same with Targets if BUY or SELL is triggered.
Please help me code
("COMMODITY TRADING");
SetChartOptions(0,chartShowArrows|chartShowDates);
dec = (Param("Decimals",2,0,7,1)/10)+1;
SetChartBkColor(ParamColor("Outer panel",colorBlack));
SetChartBkGradientFill(
ParamColor("Inner panel upper",colorBlack),
ParamColor("Inner panel lower",colorBlack));
//ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C) + "\n" + "\n" + ("***** HAPPY TRADING ***** " );
breakoutime = 110000;
afterbreakout0 = Cross(TimeNum(),110000);
afterbreakout1 = TimeNum()>=110000;
NewDay = Day()!= Ref(Day(), -1);
highestoftheday = HighestSince(newday,H,1);
Lowestoftheday =LowestSince(newday,L,1);
ORBHigh = ValueWhen(afterbreakout0,highestoftheday,1);
ORBLow = ValueWhen(afterbreakout0,lowestoftheday,1);
Buy= Cross(C,orbhigh) AND afterbreakout1;
Sell = Cross(orblow,C) AND afterbreakout1;
Short = Sell;
Cover = Buy;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Tar=Param("Target",1,1,100);
BuyFirst = ORBHigh + Tar ;
Plot(BuyFirst,"",colorGreen,styleLine);
SellFirst = ORBLow - Tar;
Plot(SellFirst,"",colorRed,styleLine ) ;
Plot(C,"",colorWhite,styleCandle);
PlotShapes( shapeUpArrow * Buy, colorGreen,0,L,-12);
PlotShapes( shapeDownArrow * Sell, colorRed,0,H,-12);
Plot(NewDay,"",colorWhite,styleHistogram|styleOwnScale);
Plot(afterbreakout0,"",colorBlue,styleHistogram|styleOwnScale);
Plot(ORBHigh,"",colorGreen,styleDots);
Plot(ORBLow,"",colorRed,styleDots);
Title = EncodeColor(55)+ Title = Name() + " " + EncodeColor(55)
+ Date() + " " + EncodeColor(55) + "{{INTERVAL}} " +
EncodeColor(55)+ " Open = "+ EncodeColor(55)+ NumToStr
(O,dec) +
EncodeColor(55)+ " High = "+ EncodeColor(55) + NumToStr
(H,dec) +
EncodeColor(55)+ " Low = "+ EncodeColor(55)+ NumToStr
(L,dec) +
EncodeColor(55)+ " Close = "+ EncodeColor(55)+ NumToStr
(C,dec) +
// EncodeColor(55)+ " BI = "+ EncodeColor(42)+ NumToStr
//(bi,1.0) +
EncodeColor(55)+ " Volume = "+ EncodeColor(55)+ NumToStr
(V,1.0) +"\n"+"\n"+
EncodeColor(55)+ " BUY ABOVE : "+ EncodeColor(55)+ NumToStr
(ORBHigh,dec) +"\n"+
EncodeColor(55)+ " TAR : "+ EncodeColor(55)+ NumToStr
(BuyFirst,dec) +"\n"+
EncodeColor(55)+ " SELL BELOW : " + EncodeColor(55)+ NumToStr
(ORBLow,dec) +"\n"+
EncodeColor(55)+ " TAR : " + EncodeColor(55)+ NumToStr
(SellFirst,dec) +"\n" ;
GraphXSpace=12;
_