Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- strategy("Frostbite Slapper Strategy", overlay=true)
- // Define Parameters
- length = input.int(14, title="RSI Length")
- atrPeriod = input.int(14, title="ATR Period")
- // Calculate RSI
- rsiValue = ta.rsi(close, length)
- // Calculate Average True Range (ATR)
- atrValue = ta.atr(atrPeriod)
- // Calculate Parabolic SAR
- sarValue = ta.sar(0.02, 0.2, 0.2) // Added the value for the `max` parameter
- // Calculate Bollinger Bands
- basis = ta.sma(close, 20)
- dev = ta.stdev(close, 20)
- upperBB = basis + dev
- lowerBB = basis - dev
- // New Indicator to Improve Intra Trade Max DD
- // Replace this indicator with an appropriate one that aims to improve the intra Trade Max DD
- newIndicator1 = ta.ema(close, 30)
- // New Indicator to Improve Sortino Ratio
- // Replace this indicator with an appropriate one that aims to improve the Sortino ratio
- newIndicator2 = ta.wma(close, 10)
- // New Indicator to Improve Omega Ratio
- // Replace this indicator with an appropriate one that aims to improve the Omega ratio
- newIndicator3 = ta.roc(close, 14)
- // New Indicator to Improve Sharpe Ratio
- // Replace this indicator with an appropriate one that aims to improve the Sharpe ratio
- newIndicator4 = ta.sma(close, 50)
- // New Indicator to Improve Profit Factor
- // Replace this indicator with an appropriate one that aims to improve the profit factor
- newIndicator5 = ta.macd(close)
- // New Indicator to Improve %Profitable
- // Replace this indicator with an appropriate one that aims to improve %profitable
- newIndicator6 = ta.stoch(close, high, low, 14)
- // Define Buy and Sell Conditions
- buyCondition = ta.crossover(close, upperBB) and rsiValue > 50 and atrValue > 0
- sellCondition = ta.crossunder(close, lowerBB) and rsiValue < 50 and atrValue > 0
- // Output Buy and Sell Signals
- if buyCondition
- strategy.entry("Buy", strategy.long)
- if sellCondition
- strategy.close("Buy")
- // Output the new indicators on the chart
- plot(newIndicator1, title="New Indicator 1", color=color.orange)
- plot(newIndicator2, title="New Indicator 2", color=color.green)
- plot(newIndicator3, title="New Indicator 3", color=color.blue)
- plot(newIndicator4, title="New Indicator 4", color=color.red)
- plot(newIndicator5, title="New Indicator 5", color=color.yellow)
- plot(newIndicator6, title="New Indicator 6", color=color.purple)
Advertisement
Comments
-
- can you make PREDICTUM & gg shot indicator code....?
Add Comment
Please, Sign In to add comment