AFL for Intraday

#12
Hi sandip1952

Personally I believe in effort and doing things with some committment.

Trading is a complicated stuff and more so on intraday front-
still I wonder why traders rush like goats to
get slaughtered in intraday trading.

Everybody thinks something which he doesnt have now,if he gets that thing , he would do miracles. The reality is exactly opposite.
Autotrading or robots-did not help my friends-they cried heavy draw downs!!!!!!!!!!!!

Is there a problem? yes big losses.
Is it system problem? or is it traders problem?
Find what is it and take time to fix it.
Trading system problem? change system.
Trader psychology or money control problem or lack of preparation problem?
Lack of trading basics education? get educated trained mentored.

Let him fix it-fix his bad habits-stop his overtrading etc.
------------------------------------------------------------
My teacher
he used to give us students problems we never heard of or think of solving.
one out of ten would go 60% of the way towards solution while rest do nothing.The requirement is a student must try to come up with more than one answer. An impossible situation.

We hated it initially.
It is only later we were told it is just part of training to enable us take a solid overall view and try to resolve problems in unknown domain.

Suppose if a student never got exposed to such a teacher,chances are he wont think of taking problems headon,but back off everytime.
Mentor is must in trading profession.

Most guys would plan doing without a mentor.
It is a costly & expensive mistake.
Not willing to put effort is dangerous mindset.Seeking comfort,seeking convenience does nt take trader much far.
more so in trading zone.
Introspect yourself and find the problem fix it. avoid trading till such time.
-------------------------------------------
Here is a link about percentage stoploss.
http://www.traderji.com/amibroker/89491-what-percent-should-stoploss-hourly-chart.html
 
#13
Hi Ford

Many thanks for your patience! In fact, I agree to all of your principles-based comments.

At 61, I have retired from a career where I believe I have been able to move to the topmost level by following those principles.

Following uncharted paths was my forte and the new path for me is trading. Yes, I lost very very heavily. That's all the more reason to stick to the path, not to abandon it. I know its potential.

I am a newbie in trading, but I found self- exclaimed experts mostly were average and some of them cheats. So I am on the search for a REAL expert who don't cheat.

However, I could not agree with you on one point.

You said ATS didn't help. What does it mean?

Suppose I have a good ATS AFL which shows profitable buy/sell signals. Do you mean these signals won't work after going through the OMS? If so, what's the reason? Some bugs at the chart-OMS interface? Some bug in the charting s/w? Something else? And has the rest of the world abandoned auto trading?

I have accepted that I AM NOT EMOTIONALLY FIT TO TRADE MANUALLY, at least not for now, being left with little financial resources. So is it time to take Sanyas? Over my dead body !

If experts are unable to offer me a solution and if you can name a good book on AFL CODING I can learn it in a month. I have done it before in 1989, when the nearest programmer I knew sat 10 kms away from my office and I taught myself to write a program (in the museum item GWBASIC) which was the first in India. Believe me, it was back-breaking. Without internet, expert advice or good books. But I can do it again.
 
#15
use this on 5 minutes time frame


TimeFrameSet(inDaily);
DayHigh = LastValue(H);
DayLow = LastValue(L);
TimeFrameRestore();

Title = Date() + ", Op=" + Open + ", Hi=" + High + ", Lo=" + Low + ", LTP=" + Close + ", Change= " + SelectedValue( ROC( C, 1 ) ) + "%" + "\n Today`s High=" + DayHigh + ", Today`s Low=" + DayLow + " © PRIME SYSTEM" ;


prev=AMA2(C,1,0);
d=IIf(C>Ref(Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),-1),Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),
IIf(C<Ref(Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),-1),Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),PREV));
a=Cross(Close,d);
b=Cross(d,Close);
state=IIf(BarsSince(a)<BarsSince(b),1,0);
s=state>Ref(state,-1);
ss=state<Ref(state,-1);
sss=state==Ref(state,-1);
col=IIf(state == 1 ,51,IIf(state ==0,4,1));
Plot(C,"",Col,64);
Buy = s;
Sell = ss;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(shape, IIf(Buy,colorGreen,colorRed), 0, IIf(Buy,Low,High));
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
//WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+" ,","");
//WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",","");
//WriteIf( sss ,"No trading signals today.","") ;


dist = 0.8*ATR(10);
dist1 = 2*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
PlotText( "\nBuy:" + L[ i ] + "\nT= " + (L*1.005) + "\nSL= " + (L*0.9975), i, L[ i ]-dist, colorGreen, colorWhite );
}
if( Sell )
{
PlotText( "Sell:" + H[ i ] + "\nT= " + (H*0.995) + "\nSL= " + (H*1.0025), i, H[ i ]+dist1, colorRed, colorWhite );
}
}


Filter = s OR sss OR sss ;
AddColumn(C,"close",1.2);
AddColumn( IIf( s, 66,1 ), "buy", formatChar, 1, bkcolor =IIf (s,colorYellow, colorPink ));
AddColumn( IIf( Ss, 83,1 ), "sell", formatChar, 1, bkcolor =IIf (Ss,colorPink, colorWhite ));
AddColumn( IIf( sss, 87,1 ), "wait", formatChar, 1, bkcolor =IIf (sss,colorYellow, colorRed ));


_SECTION_BEGIN("swing1");
no=20;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
supres=IIf(avn==1,sup,res);
a=Cross(C,supres);
b=Cross(supres,C);
style = a * styleStaircase + b * styleStaircase;
PlotShapes(a,style, IIf(a,colorGreen,colorRed), 0, IIf(a,Low,High));
Plot(supres,"Swing",colorYellow,styleStaircase);
_SECTION_END();



_SECTION_BEGIN("trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();

Buy = s AND a AND uptrend ;
Short = ss AND b AND downtrend ;
Sell = ss AND b AND downtrend ;
Cover = s AND a AND uptrend ;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Cover=ExRem(Cover,Short);
Short=ExRem(Short,Cover);

Filter=Buy OR Sell;
Filter= Cover OR Short;

AddColumn( Buy, "Buy", 1);
AddColumn(Sell, "Sell", 1);
AddColumn(Close,"Close",1.2);
AddColumn(Volume,"Volume",1.0);


// Plot the Buy and Sell arrows.
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);





//plot volume graph

// set background gradient colours
SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )),ParamColor("BgBottom", ColorRGB( 102,136,187 )),ParamColor("titleblock",ColorRGB( 255,255,255 )));

GraphXSpace = 5;

Hello,
can u provide me 1 min time frame also?
thanks in advance
 
#17
Respected Members
Anaybody can change the above afl's Enery Point, Target & Sl,
Just Like Risk Rewards 1:1, 2:1, 3:1

Warm Regards
Chinmay

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, High %g, Low %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("Signal Panel");
no=10;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
s5d=IIf(avn==1,sup,res);

showsl = ParamToggle("Stop Loss Line", "Show|Hide", 0);
if (showsl == 1)
{Plot(s5d,"Stop Loss",colorCustom14,styleDots);}

exitlong = Cross(s5d, H);
PlotShapes(exitlong * shapeNone, colorBlack,0,H,-10);
exitshort = Cross(L, s5d);
PlotShapes(exitshort * shapeNone, colorBlack,0,L,-15);

Buy = exitshort;
Sell = exitlong;
//Short = Sell;
//Cover = Buy;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
//Short = ExRem(Short, Cover);
//Cover = ExRem(Cover, Short);
AlertIf( Buy, "", "Buy @ " + C, 1 );
AlertIf( Sell, "", "Sell @ " + C, 2 );

for(i=BarCount-1;i>1;i--)
{
if(Buy == 1)
{
entry = C;
sig = "Buy";
sl = s5d;
tar1 = entry + (entry * .0050);
tar2 = entry + (entry * .0092);
tar3 = entry + (entry * .0179);

bars = i;
i = 0;
}
if(Sell == 1)
{
sig = "Sell";
entry = C;
sl = s5d;
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);


bars = i;
i = 0;
}
}
Offset = 20;
Clr = IIf(sig == "Buy", colorLime, colorRed);
ssl = IIf(bars == BarCount-1, s5d[BarCount-1], Ref(s5d, -1));
sl = ssl[BarCount-1];

Plot(LineArray(bars-Offset, tar1, BarCount, tar1,1), "", Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar2, BarCount, tar2,1), "", Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar3, BarCount, tar3,1), "", Clr, styleLine|styleDots, Null, Null, Offset);

Plot(LineArray(bars-Offset, sl, BarCount, sl,1), "", colorDarkRed, styleLine|styleLine, Null, Null, Offset);
Plot(LineArray(bars-Offset, entry, BarCount, entry,1), "", colorGreen, styleLine|styleLine, Null, Null, Offset);

for (i=bars; i <BarCount;i++)
{
PlotText(""+sig+"@"+entry, BarCount-3,entry,Null,colorBlue);
PlotText("TGT-1@"+tar1,BarCount-4,tar1,Null,Clr);PlotText("TGT-2@"+tar2,BarCount-4,tar2,Null,Clr);PlotText ("TGT-3@"+tar3,BarCount-4,tar3,Null,Clr);

}

messageboard = ParamToggle("Message Board","Show|Hide",1);
if (messageboard == 1 )
{
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorWhite );

if ( sig =="Buy")
{
GfxSelectSolidBrush( colorBlue ); // this is the box background color
}
else
{
GfxSelectSolidBrush( colorRed ); // this is the box background color
}
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 5;
x2 = 310;

y = pxHeight;

GfxSelectPen( colorGreen, 5); // broader color
GfxRoundRect( x, y - 142, x2, y , 7, 7 ) ;
GfxTextOut( Name(),12,y-140);
GfxTextOut( " Last Traded Price = "+ C , 08,y- 120 );
GfxTextOut( ( "Signal Panel"),160,y-140);
GfxTextOut( (" "),27,y-160);
GfxTextOut( ("Last " + sig + " Signal came " + (BarCount-bars-1) * Interval()/60 + " mins ago"), 13, y-100) ; // The text format location
GfxTextOut( ("" + WriteIf(sig =="Buy",sig + " @ ",sig + " @") + " : " + entry), 13, y-80);
GfxTextOut( ("Trailing Stop Loss : " + sl + " (P/L:" + WriteVal(IIf(sig == "Sell",entry-sl,sl-entry), 2.2) + ")"), 13, y-60);
GfxTextOut( ("TGT:1 : " + tar1), 13, y -40);
GfxTextOut( ("Current Profit/Loss : " + WriteVal(IIf(sig == "BUY",(C-entry),(entry-C)),2.2)), 40, y-22);;

}
_SECTION_END();



_SECTION_BEGIN("Sound Alert");
AlertIf( Buy, "SOUND C:\\Windows\\Media\\Chord.wav", "Sell " + C,2,1+2,1);
AlertIf( Sell, "SOUND C:\\Windows\\Media\\tada.wav","Buy " + C,1,1+2,1);
_SECTION_END();



_SECTION_BEGIN("Magnified Market Price");
FS=Param("Font Size",15,30,100,1);
GfxSelectFont("Arial", FS, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorBlue) );
Hor=Param("Horizontal Position",750,800,800,800);
Ver=Param("Vertical Position",27,27,27,27);
GfxTextOut("L.T.P="+C,Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Arial", 12, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorYellow) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor+5.45, Ver+45 );
_SECTION_END();


_SECTION_BEGIN("");
GfxSetOverlayMode(0);
GfxSelectPen( colorRed, 3 );
GfxSelectSolidBrush( colorLightYellow );
GfxRoundRect( 350, 38,665, 70, 15, 15 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 17.5, 700, False );
GfxSetTextColor( colorBrown );
GfxSetTextAlign(0);
GfxSetTextColor( colorBlack );
GfxTextOut( " Last Traded Price = "+ BuyPrice , 350, 40);
_SECTION_END();


_SECTION_BEGIN("Isfandi Technical Viewer");
//Plot(C,"",ParamColor( "Color", colorBlue ),ParamStyle("Style") );
//---- pivot points
GfxSetBkColor(colorBlue);
GfxSetTextColor( colorLime );
GfxSelectFont("Times New Roman", 20, 1,500, True );
GfxTextOut(" Intraday Trading System ", 20 , 40 );
_SECTION_END();


_SECTION_BEGIN(" Buy Sell Signal Confirm ");
BarColors =
IIf(BarsSince(Buy) < BarsSince(Sell)
AND BarsSince(Buy)!=0, colorGreen,
IIf(BarsSince(Sell) < BarsSince(Buy)
AND BarsSince(Sell)!=0, colorRed, colorBlue));
//Plot the Candlestick charts
Plot(C, "Close", BarColors, styleNoTitle | ParamStyle("Style") | GetPriceStyle() ) ;
_SECTION_END();

_SECTION_BEGIN("Show Up Down Arrow & Price ");
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
AlertIf( Buy, "SOUND C:\\Windows\\Media\\Chord.wav", "Audio alert", 2 );
AlertIf( Sell, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 2 );

dist = 1.8*ATR(15);
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy@" + L[ i ], i, L[ i ]-dist, colorWhite, colorGreen );
if( Sell ) PlotText( "Sell@" + H[ i ], i, H[ i ]+dist, colorWhite, colorRed );
}


PlotShapes( shape, IIf( Buy, colorBlue, colorRed ), 0, IIf( Buy, Low, High )
);

_SECTION_END();
 
#19
Hi All,

Me very new to trading,. me bit interested in Algorithm trading. please suggest me from wer to start
Hi friend,
Catch me at traderzonlyatgmaildotcom
Im an intraday trader and looking to form a strong team to trade together using technical analysis. There is no cost involved.
catch me at the above email id if interested
 
#20
Hi,
I want to auto-trade with this AFL discussed above....it works great on forex 1-min charts.....there is one problem though....the symphony support people are saying that proper plotting for buy/sell/short/cover triggers is not done and so the auto-trading platform isnt receiving the triggers.... can anyone help in this please?

Here is the AFL i am talking about:

TimeFrameSet(inDaily);
DayHigh = LastValue(H);
DayLow = LastValue(L);
TimeFrameRestore();

Title = Date() + ", Op=" + Open + ", Hi=" + High + ", Lo=" + Low + ", LTP=" + Close + ", Change= " + SelectedValue( ROC( C, 1 ) ) + "%" + "\n Today`s High=" + DayHigh + ", Today`s Low=" + DayLow + " © PRIME SYSTEM" ;


prev=AMA2(C,1,0);
d=IIf(C>Ref(Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),-1),Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),
IIf(C<Ref(Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),-1),Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),PREV));
a=Cross(Close,d);
b=Cross(d,Close);
state=IIf(BarsSince(a)<BarsSince(b),1,0);
s=state>Ref(state,-1);
ss=state<Ref(state,-1);
sss=state==Ref(state,-1);
col=IIf(state == 1 ,51,IIf(state ==0,4,1));
Plot(C,"",Col,64);
Buy = s;
Sell = ss;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(shape, IIf(Buy,colorGreen,colorRed), 0, IIf(Buy,Low,High));
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
//WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+" ,","");
//WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",","");
//WriteIf( sss ,"No trading signals today.","") ;


dist = 0.8*ATR(10);
dist1 = 2*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
PlotText( "\nBuy:" + L[ i ] + "\nT= " + (L*1.005) + "\nSL= " + (L*0.9975), i, L[ i ]-dist, colorGreen, colorWhite );
}
if( Sell )
{
PlotText( "Sell:" + H[ i ] + "\nT= " + (H*0.995) + "\nSL= " + (H*1.0025), i, H[ i ]+dist1, colorRed, colorWhite );
}
}


Filter = s OR sss OR sss ;
AddColumn(C,"close",1.2);
AddColumn( IIf( s, 66,1 ), "buy", formatChar, 1, bkcolor =IIf (s,colorYellow, colorPink ));
AddColumn( IIf( Ss, 83,1 ), "sell", formatChar, 1, bkcolor =IIf (Ss,colorPink, colorWhite ));
AddColumn( IIf( sss, 87,1 ), "wait", formatChar, 1, bkcolor =IIf (sss,colorYellow, colorRed ));


_SECTION_BEGIN("swing1");
no=20;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
supres=IIf(avn==1,sup,res);
a=Cross(C,supres);
b=Cross(supres,C);
style = a * styleStaircase + b * styleStaircase;
PlotShapes(a,style, IIf(a,colorGreen,colorRed), 0, IIf(a,Low,High));
Plot(supres,"Swing",colorYellow,styleStaircase);
_SECTION_END();



_SECTION_BEGIN("trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();

Buy = s AND a AND uptrend ;
Short = ss AND b AND downtrend ;
Sell = ss AND b AND downtrend ;
Cover = s AND a AND uptrend ;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Cover=ExRem(Cover,Short);
Short=ExRem(Short,Cover);

Filter=Buy OR Sell;
Filter= Cover OR Short;

AddColumn( Buy, "Buy", 1);
AddColumn(Sell, "Sell", 1);
AddColumn(Close,"Close",1.2);
AddColumn(Volume,"Volume",1.0);


// Plot the Buy and Sell arrows.
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);