texte des take profit sur bougies avec DRAWTEXT
Forums › ProRealTime forum Français › Support ProBuilder › texte des take profit sur bougies avec DRAWTEXT
- This topic has 2 replies, 2 voices, and was last updated 1 year ago by AMD.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
02/25/2023 at 3:06 PM #210470
Bonjour, J’ai un soucis sur un code que j’ai trouvé ici et modifié. Je voudrais faire apparaitre sur la bougie mes TP quand celle-ci rentre des les paramètres prédéfinie et non sur la bougie barindex. MERCI !
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687// --- settingsdefparam drawonlastbaronly = falsesarclose = SAR[0.9,0.9,0.9]sarslow=SAR[0.04,0.04,0.4]sarfast=SAR[0.06,0.06,0.6]//colorsif close>sarfast then //bullishr=0g=255else //bearishr=255g=0endif//highs and lowsif close<sarfast thenll=min(ll,low)elsehh=max(hh,high)endifif close>sarfast and close[1]<sarfast[1] then //new bullish signalfibo0=llll=sarslow //reset llif close>sarslow thenstartbar=barindex[0]irange1=high-fibo0entry = fibo0+(irange1/2)itarget = entry+pointsizeitarget2 = entry+pointsize+2itarget3 = entry+pointsize+3itarget4 = entry+pointsize+4itarget5 = entry+pointsize+5itarget6 = entry+pointsize+6itarget7 = entry+pointsize+10itarget8 = entry+pointsize+15itarget9 = entry+pointsize+20itarget10 = entry+pointsize+30itarget11 = entry+pointsize+35itarget12 = entry+pointsize+40itarget13 = entry+pointsize+45itarget14 = entry+pointsize+50istop = fibo0-2*pointsizedrawarrowup(barindex, low) coloured(255,255,255)drawtext("BE",barindex,itarget2,dialog,standard,10) coloured(250,250,250)drawtext("TP1",barindex,itarget5,dialog,standard,10) coloured(250,250,250)drawtext("TP2",barindex,itarget7,dialog,standard,10) coloured(250,250,250)drawtext("TP3",barindex,itarget8,dialog,standard,10) coloured(250,250,250)endifendifif close<sarfast and close[1]>sarfast[1] then //new bearish signalfibo0=hhhh=0 //reset hhif close<sarslow thenstartbar=barindex[0]irange2=fibo0-lowentry = fibo0-(irange2/2)itarget = entry-pointsizeitarget2 = entry-pointsize-2itarget3 = entry-pointsize-3itarget4 = entry-pointsize-4itarget5 = entry-pointsize-5itarget6 = entry-pointsize-6itarget7 = entry-pointsize-7itarget8 = entry-pointsize-8itarget9 = entry-pointsize-9itarget10 = entry-pointsize-10itarget11 = entry-pointsize-11itarget12 = entry-pointsize-12itarget13 = entry-pointsize-13itarget14 = entry-pointsize-14istop = fibo0+2*pointsizedrawarrowdown(barindex, high ) coloured(255,255,255)drawtext("BE",barindex,itarget2,dialog,standard,10) coloured(250,250,250)drawtext("TP1",barindex,itarget5,dialog,standard,10) coloured(250,250,250)drawtext("TP2",barindex,itarget7,dialog,standard,10) coloured(250,250,250)drawtext("TP3",barindex,itarget8,dialog,standard,10) coloured(250,250,250)endifendifreturn sarfast as"SARFAST" coloured(r,g,0) style(line,1),sarslow as"SARLOW" coloured(0,195,255) style(line,1),sarclose as"SARCLOSE" coloured(255, 0, 255) style(line,1)02/27/2023 at 9:29 AM #210579La version du code de cet indicateur de signaux, ci-dessous, place les textes correspondants aux TP1, TP2 et TP3 uniquement si le prix les atteint.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105// --- settingsdefparam drawonlastbaronly = falsesarclose = SAR[0.9,0.9,0.9]sarslow=SAR[0.04,0.04,0.4]sarfast=SAR[0.06,0.06,0.6]//colorsif close>sarfast then //bullishr=0g=255else //bearishr=255g=0endif//highs and lowsif close<sarfast thenll=min(ll,low)elsehh=max(hh,high)endifif close>sarfast and close[1]<sarfast[1] then //new bullish signalfibo0=llll=sarslow //reset llif close>sarslow thentype=1startbar=barindex[0]irange1=high-fibo0entry = fibo0+(irange1/2)itarget = entry+pointsizeitarget2 = entry+pointsize+2itarget3 = entry+pointsize+3itarget4 = entry+pointsize+4itarget5 = entry+pointsize+5itarget6 = entry+pointsize+6itarget7 = entry+pointsize+10itarget8 = entry+pointsize+15itarget9 = entry+pointsize+20itarget10 = entry+pointsize+30itarget11 = entry+pointsize+35itarget12 = entry+pointsize+40itarget13 = entry+pointsize+45itarget14 = entry+pointsize+50istop = fibo0-2*pointsizedrawarrowup(barindex, low) coloured(255,255,255)drawtext("BE",barindex,itarget2,dialog,standard,10) coloured(250,250,250)//drawtext("TP1",barindex,itarget5,dialog,standard,10) coloured(250,250,250)//drawtext("TP2",barindex,itarget7,dialog,standard,10) coloured(250,250,250)//drawtext("TP3",barindex,itarget8,dialog,standard,10) coloured(250,250,250)endifendifif close<sarfast and close[1]>sarfast[1] then //new bearish signalfibo0=hhhh=0 //reset hhif close<sarslow thentype=-1startbar=barindex[0]irange2=fibo0-lowentry = fibo0-(irange2/2)itarget = entry-pointsizeitarget2 = entry-pointsize-2itarget3 = entry-pointsize-3itarget4 = entry-pointsize-4itarget5 = entry-pointsize-5itarget6 = entry-pointsize-6itarget7 = entry-pointsize-7itarget8 = entry-pointsize-8itarget9 = entry-pointsize-9itarget10 = entry-pointsize-10itarget11 = entry-pointsize-11itarget12 = entry-pointsize-12itarget13 = entry-pointsize-13itarget14 = entry-pointsize-14istop = fibo0+2*pointsizedrawarrowdown(barindex, high ) coloured(255,255,255)drawtext("BE",barindex,itarget2,dialog,standard,10) coloured(250,250,250)//drawtext("TP1",barindex,itarget5,dialog,standard,10) coloured(250,250,250)//drawtext("TP2",barindex,itarget7,dialog,standard,10) coloured(250,250,250)//drawtext("TP3",barindex,itarget8,dialog,standard,10) coloured(250,250,250)endifendif//check takeprofitif type=1 then //buy signalif high crosses over itarget5 thendrawtext("TP1",barindex,itarget5,dialog,standard,10) coloured(250,250,250)elsif high crosses over itarget7 thendrawtext("TP2",barindex,itarget7,dialog,standard,10) coloured(250,250,250)elsif high crosses over itarget8 thendrawtext("TP3",barindex,itarget8,dialog,standard,10) coloured(250,250,250)endifelsif type=-1 then //sell signalif low crosses under itarget5 thendrawtext("TP1",barindex,itarget5,dialog,standard,10) coloured(250,250,250)elsif low crosses under itarget7 thendrawtext("TP2",barindex,itarget7,dialog,standard,10) coloured(250,250,250)elsif low crosses under itarget8 thendrawtext("TP3",barindex,itarget8,dialog,standard,10) coloured(250,250,250)endifendifreturn sarfast as"SARFAST" coloured(r,g,0) style(line,1),sarslow as"SARLOW" coloured(0,195,255) style(line,1),sarclose as"SARCLOSE" coloured(255, 0, 255) style(line,1)02/27/2023 at 9:45 AM #210583 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: