Indicateur target

inputs:

length(7),

TextBarsBack(5),

TextPricePercent(100),

target(green),

stopL(red),

multipleTarget (0.15),

multipleStopL (0.1);

variables:

var0(0),

ProfitTarget(0),

StopLoss(0),

txt(-1),

txt2(-1),

txttarget(-1),

txtstop(-1);

ProfitTarget = AvgTrueRange( Length )of data2*multipleTarget *pricescale/10;

StopLoss = AvgTrueRange( Length )of data2*multipleStopL*pricescale/10;

if BarNumber=1 then begin

txt = text_new(date, Time, Close, NumToStr(ProfitTarget,0));

txttarget = text_new(date, Time, Close, « target »);

txt2 = text_new(date, Time, Close, NumToStr(StopLoss,0));

txtstop = text_new(date, Time, Close, « Stop »);

end;

Text_Float(txt, TextBarsBack, TextPricePercent);

text_setstring(txt, NumToStr(ProfitTarget,0));

text_setcolor(txt,target);

Text_Float(txttarget, TextBarsBack+5, TextPricePercent);

text_setstring(txttarget,« Target = »);

text_setcolor(txttarget,target);

Text_Float(txt2, TextBarsBack, TextPricePercent5);

text_setstring(txt2, NumToStr(StopLoss,0));

text_setcolor(txt2,StopL);

Text_Float(txtstop, TextBarsBack+5, TextPricePercent5);

text_setstring(txtstop, « Stop = »);

text_setcolor(txtstop,StopL);



About this entry