Buy sell by lines on chart like trade tiger in amibroker

c.trader

Active Member
#1
this alf has three lines to draw en entry line ,tg taget line,sl stoploss line
put his afl on plane candlestick chart
draw horizontal line on chart -double click on it -in study id type en entry line
same as short form for tg and stoploss
i request to seneours please add buy sell signal on this afl
means when price touch en -entry line buy/ sell signal generate
buy if sl is put below and target place above EN line
sell if SL i put above and target TG line below En line
square off as target or stoploss hit first





Plot(C, "Price", colorBlack, styleCandle,Null,Null,0);
_SECTION_BEGIN("risk profile");

SetBarsRequired(1000000,1000000);
BlankBarsInRightMargin = 25;
LastVisiblebar = Status("firstvisiblebarindex");
FirstVisibleBar= Status("lastvisiblebarindex")-BlankBarsInRightMargin;

Entry_Study = Study("EN", GetChartID() );
Entry = LastValue( ValueWhen( ExRem( Entry_Study, 0 ), Entry_Study ) );

Target_Study = Study("TG", GetChartID() );
Target = LastValue( ValueWhen( ExRem( Target_Study, 0 ), Target_Study ) );

StopLoss_Study = Study("SL", GetChartID() );
StopLoss = LastValue( ValueWhen( ExRem( StopLoss_Study, 0 ), StopLoss_Study ) );

Reward=Target-Entry;
Risk=Entry-StopLoss;
RRR=Reward/Risk;
p_reward=reward*100/Entry;
p_Risk=Risk*100/Entry;

PlotText("StopLoss: "+StopLoss,FirstVisibleBar-2,StopLoss,colorBlack);
PlotText("Entry: "+Entry,FirstVisibleBar-2,Entry,colorBlack);
PlotText("Entry",LastVisiblebar+2,Entry,colorBlack);
PlotText("Target: "+Target,FirstVisibleBar-2,Target,colorBlack);
PlotText("Target",LastVisiblebar+2,Target,colorBlack);
PlotText("Stoploss",LastVisiblebar+2,StopLoss,colorBlack);
PlotText("Risk: "+Prec(abs(Risk), 2 )+" (%"+Prec(abs(P_Risk), 2 )+")",FirstVisibleBar-2,StopLoss+Risk/2,colorRed);
PlotText("Reward: "+Prec(abs(Reward), 2 )+" (%"+Prec(abs(p_reward), 2 )+")",FirstVisibleBar-2,Entry+Reward/2,colorGreen);
PlotText("RRR: "+Prec(abs(RRR), 2 ),FirstVisibleBar-30,StopLoss,colorBlack);

PlotOHLC( Entry, Entry, Target, Target, "", ColorRGB(220,250,220),styleCloud|styleNoRescale,Null,Null,20 );
PlotOHLC( Entry, Entry, StopLoss, StopLoss, "", ColorRGB(250,220,220),styleCloud|styleNoRescale,Null,Null,20 );

_SECTION_END();
Attachments
TG.png
 

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?