Sorry
I tried to correct it, but couldnt.
May be someone can do it.
I tried to correct it, but couldnt.
May be someone can do it.
TRY THIS WITH BUY SELL SIGNAL
ENJOY
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{Name}} - {{Interval}} {{Date}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
_SECTION_BEGIN("Small Triggers");
p1 = Param("TL 1 Periods", 20, 5, 50, 1);
p2 = Param("TL 2 Periods", 5, 3, 25, 1);
TL1 = LinearReg(C, p1);
TL2 = EMA(TL1, p2);
Col1 = IIf(TL1 > TL2, ParamColor("TL Up Colour", colorBrightGreen), ParamColor("TL Dn Colour", colorCustom12));
Plot(TL1, "TriggerLine 1", Col1, styleLine|styleThick|styleNoLabel);
Plot(TL2, "TriggerLine 2", Col1, styleLine|styleThick|styleNoLabel);
_SECTION_END();
_SECTION_BEGIN("trailstops");
EntrySignal = C > ( LLV( L, 20 ) + 2 * ATR( 10 ) );
ExitSignal = C < ( HHV( H, 20 ) - 2 * ATR( 10 ) );
Color = IIf( EntrySignal, colorBlue, IIf( ExitSignal, colorOrange, colorGrey50 ));
TrailStop = HHV( C - 2 * ATR(10), 15 );
ProfitTaker = EMA( H, 13 ) + 2 * ATR(10);
/* plot price chart and stops */
Plot( TrailStop, "Trailing stop", colorGold, styleThick | styleLine );
Plot( C, "Price", color, styleBar );
/* plot color ribbon */
Plot( 2, "", Color, styleArea | styleOwnScale | styleNoLabel, -0.1, 50 );
SetChartOptions(0,chartShowArrows|chartShowDates);
NewDay = Day()!= Ref(Day(), -1);
DH = HHV( H, NewDay);
DL = LLV(L, NewDay);
Plot(DH,"DAY HIGH",colorOrange,ParamStyle("Style"),0,0,0);
Plot(DL,"DAY LOW",colorPaleGreen,ParamStyle("Style"),0,0,0);
R1=((DH-DL)*0.33)+DL;
R2=((DH-DL)*0.66)+DL;
Plot(R1,"BEARISH BELOW",colorYellow,styleDashed,0,0,0);
Plot(R2,"BULLISH ABOVE",colorTurquoise,styleDashed,0,0,0);
exitlong = Cross(R2, C);
exitshort = Cross(C, R1);
Sell= exitshort;
Buy = exitlong;
Short = Sell;
Cover = Buy;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);
shape=Buy*shapeUpArrow+Sell*shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, L-10, IIf(Sell,H+10,Null)));
PlotOHLC( Open, High, Low, Close, "", colorLime, styleBar| styleThick );
_SECTION_END();
_SECTION_BEGIN("Dots Color");
acc = Param("Acceleration", 0.01, 0, 1, 0.001 );
accm = Param("Max. acceleration", 0.1, 0, 1, 0.001 );
myColor = IIf (C > SAR( acc, accm ) , colorGreen , colorRed);
Plot( SAR( acc, accm ), _DEFAULT_NAME(), myColor , ParamStyle("Style", styleDots |styleThick | styleNoLine, maskDefault | styleDots | styleThick | styleNoLine ) );
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Magnified Market Price");
FS=Param("Font Size",30,30,100,1);
GfxSelectFont("Arial", FS, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorBlue) );
Hor=Param("Horizontal Position",200,800,800,800);
Ver=Param("Vertical Position",50,27,27,27);
_SECTION_END();
_SECTION_BEGIN("MASSAGE BOARD 2");
for(i=BarCount-1;i>1;i--)
{
if(Buy == 1)
{
entry = C;
sig = "BUY";
tar1 = entry + (entry * .0050);
tar2 = entry + (entry * .0092);
tar3 = entry + (entry * .0179);
bars = i;
i = 0;
}
if(Sell == 1)
{
sig = "SELL";
entry = C;
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);
bars = i;
i = 0;
}
}
Offset = 20;
Clr = IIf(sig == "BUY", colorLime, colorRed);
messageboard =1;// ParamToggle("Message Board","Show|Hide",1);
if (messageboard == 1 )
{
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );
if ( sig =="BUY")
{
GfxSelectSolidBrush( colorGreen ); // this is the box background color
}
else
{
GfxSelectSolidBrush( colorRed ); // this is the box background color
}
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 10;
x = 0;
x2 = 125;
y = pxHeight;
GfxSelectPen( colorGreen, 1); // broader color
GfxRoundRect( x, y - 60, x2, y , 7, 7 ) ;
GfxTextOut( ( "PROFIT/LOSS"),5,y-61);
GfxTextOut( ("" + sig + " SIG " + (BarCount-bars-1) * Interval()/60 + "m ago"), 1, y-47) ;
GfxTextOut( ("" + WriteIf(sig =="BUY",sig + " @ ",sig + " @") + " : " + entry), 1, y-33);
GfxTextOut( ("Cur P/L : " + WriteVal(IIf(sig == "BUY",(C-entry),(entry-C)),2.2)), 1, y-19);;
}
Plot(LineArray(bars-Offset, entry, BarCount, entry,1), "", colorYellow, styleLine|styleLine, Null, Null, Offset);
_SECTION_END();