Conversion STOP HUNT indicateur
Forums › ProRealTime forum Français › Support ProBuilder › Conversion STOP HUNT indicateur
- This topic has 5 replies, 3 voices, and was last updated 3 weeks ago by AdilMed10.
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
10/17/2024 at 11:55 AM #239141
Bonjour tout le monde, j’espère que vous allez bien.
SVP pourriez vous me convertir ce script que je trouve intéressant et peut éventuellement aider les traders da la communauté Prorealcode. Merci beaucoup
Stop Hunt Indicateur1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374//@version=5//Revision: Updated script to pine script version 5//added Double RSI for Long/Short prosition trend confirmation instead of single RSI//@author:"Iroshan_Rathnayake"strategy("Scalp_Hunt", overlay=true)source = closeatrlen = input.int(14, "ATR Period")mult = input.float(1, "ATR Multi", step=0.1)smoothing = input.string(title="ATR Smoothing", defval="WMA", options=["RMA", "SMA", "EMA", "WMA"])ma_function(source, atrlen) =>if smoothing == "RMA"ta.rma(source, atrlen)elseif smoothing == "SMA"ta.sma(source, atrlen)elseif smoothing == "EMA"ta.ema(source, atrlen)elseta.wma(source, atrlen)atr_slen = ma_function(ta.tr(true), atrlen)upper_band = atr_slen * mult + closelower_band = close - atr_slen * mult// Create Indicator'sShortEMAlen = input.int(21, "Fast EMA")LongEMAlen = input.int(65, "Slow EMA")shortSMA = ta.ema(close, ShortEMAlen)longSMA = ta.ema(close, LongEMAlen)RSILen1 = input.int(25, "Fast RSI Length")RSILen2 = input.int(100, "Slow RSI Length")rsi1 = ta.rsi(close, RSILen1)rsi2 = ta.rsi(close, RSILen2)atr = ta.atr(atrlen)//RSI Cross conditionRSILong = rsi1 > rsi2RSIShort = rsi1 < rsi2// Specify conditionslongCondition = open < lower_bandshortCondition = open > upper_bandGoldenLong = ta.crossover(shortSMA,longSMA)Goldenshort = ta.crossover(longSMA,shortSMA)plotshape(shortCondition, title="Sell Label", text="Sell", location=location.abovebar, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)plotshape(longCondition, title="Buy Label", text="Buy", location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)plotshape(Goldenshort, title="Golden Sell Label", text="Golden Crossover Short", location=location.abovebar, style=shape.labeldown, size=size.tiny, color=color.blue, textcolor=color.white, transp=0)plotshape(GoldenLong, title="Golden Buy Label", text="Golden Crossover Long", location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.yellow, textcolor=color.white, transp=0)// Execute trade if condition is Trueif (longCondition)stopLoss = low - atr * 2takeProfit = high + atr * 5strategy.entry("long", strategy.long, when = RSILong)if (shortCondition)stopLoss = high + atr * 2takeProfit = low - atr * 5strategy.entry("short", strategy.short, when = RSIShort)// Plot ATR bands to chart////ATR Up/Low Bandsplot(upper_band)plot(lower_band)// Plot Moving Averagesplot(shortSMA, color = color.red)plot(longSMA, color = color.yellow)10/17/2024 at 3:56 PM #239152Holà. Ici, vous avez la stratégie élaborée.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253defparam cumulateorders=falsesource=closeatrlen=14mult=1smoothing=2atrSlen=average[atrlen,smoothing](tr)upperBand=atrSlen*mult+closelowerBand=-atrSlen*mult+closeShortEMAlen=21LongEMAlen=65shortSMA=average[ShortEMAlen,1](close)longSMA=average[LongEMAlen,1](close)RSIlen1=25RSIlen2=100rsi1=rsi[RSIlen1](close)rsi2=rsi[RSIlen2](close)atr=averagetruerange[atrlen](source)RSILong=rsi1>rsi2RSIshort=rsi1<rsi2longcondition=open<lowerbandshortcondition=open>upperbandGoldenLong=shortSMA crosses over longSMAGoldenShort=longSMA crosses over shortSMAif longCondition and RSILong thentakeprofit=high+atr*5stoploss=low-atr*2buy 1 contract at marketset stop price stoplossset target price takeprofitendifif shortCondition and RSIShort thenstoploss=high+atr*2takeprofit=low-atr*5sellshort 1 contract at marketset stop price stoplossset target price takeprofitendifgraphonprice upperBand coloured("purple")graphonprice lowerband coloured("purple")graphonprice shortSMA coloured("red")graphonprice longSMA coloured("blue")graph RSI1 coloured("red")graph RSI2 coloured("blue")1 user thanked author for this post.
10/17/2024 at 5:30 PM #23915810/18/2024 at 11:27 AM #239187Bonjour,
Ces messages d’erreurs laissent entrevoir la possibilité que le code a peut-être été entré par erreur dans l’onglet de gauche “indicateurs” au lieu de l’onglet “probacktest et trading auto” ?
(cf image ci-jointe pour localiser ces onglets en v11 et en v12)
10/20/2024 at 11:39 AM #23926610/24/2024 at 6:16 PM #239427Holà. Ici, vous avez la stratégie élaborée.
j ‘ai un msg d’erreur pour la première ligne , 34,35 et 36 , vous pouvez vérifier cela svp ? voici l ‘erreur: commande inconnue , merci bcp pour votre aide1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253defparam cumulateorders=falsesource=closeatrlen=14mult=1smoothing=2atrSlen=average[atrlen,smoothing](tr)upperBand=atrSlen*mult+closelowerBand=–atrSlen*mult+closeShortEMAlen=21LongEMAlen=65shortSMA=average[ShortEMAlen,1](close)longSMA=average[LongEMAlen,1](close)RSIlen1=25RSIlen2=100rsi1=rsi[RSIlen1](close)rsi2=rsi[RSIlen2](close)atr=averagetruerange[atrlen](source)RSILong=rsi1>rsi2RSIshort=rsi1<rsi2longcondition=open<lowerbandshortcondition=open>upperbandGoldenLong=shortSMA crosses over longSMAGoldenShort=longSMA crosses over shortSMAif longCondition and RSILong thentakeprofit=high+atr*5stoploss=low–atr*2buy 1 contract at marketset stop price stoplossset target price takeprofitendifif shortCondition and RSIShort thenstoploss=high+atr*2takeprofit=low–atr*5sellshort 1 contract at marketset stop price stoplossset target price takeprofitendifgraphonprice upperBand coloured(“purple”)graphonprice lowerband coloured(“purple”)graphonprice shortSMA coloured(“red”)graphonprice longSMA coloured(“blue”)graph RSI1 coloured(“red”)graph RSI2 coloured(“blue”) -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
Find exclusive trading pro-tools on
Similar topics: