planner_midi

Frostbite Slapper Strategy

Aug 2nd, 2023
126
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. //@version=5
  2. strategy("Frostbite Slapper Strategy", overlay=true)
  3.  
  4. // Define Parameters
  5. length = input.int(14, title="RSI Length")
  6. atrPeriod = input.int(14, title="ATR Period")
  7.  
  8. // Calculate RSI
  9. rsiValue = ta.rsi(close, length)
  10.  
  11. // Calculate Average True Range (ATR)
  12. atrValue = ta.atr(atrPeriod)
  13.  
  14. // Calculate Parabolic SAR
  15. sarValue = ta.sar(0.02, 0.2, 0.2) // Added the value for the `max` parameter
  16.  
  17. // Calculate Bollinger Bands
  18. basis = ta.sma(close, 20)
  19. dev = ta.stdev(close, 20)
  20. upperBB = basis + dev
  21. lowerBB = basis - dev
  22.  
  23. // New Indicator to Improve Intra Trade Max DD
  24. // Replace this indicator with an appropriate one that aims to improve the intra Trade Max DD
  25. newIndicator1 = ta.ema(close, 30)
  26.  
  27. // New Indicator to Improve Sortino Ratio
  28. // Replace this indicator with an appropriate one that aims to improve the Sortino ratio
  29. newIndicator2 = ta.wma(close, 10)
  30.  
  31. // New Indicator to Improve Omega Ratio
  32. // Replace this indicator with an appropriate one that aims to improve the Omega ratio
  33. newIndicator3 = ta.roc(close, 14)
  34.  
  35. // New Indicator to Improve Sharpe Ratio
  36. // Replace this indicator with an appropriate one that aims to improve the Sharpe ratio
  37. newIndicator4 = ta.sma(close, 50)
  38.  
  39. // New Indicator to Improve Profit Factor
  40. // Replace this indicator with an appropriate one that aims to improve the profit factor
  41. newIndicator5 = ta.macd(close)
  42.  
  43. // New Indicator to Improve %Profitable
  44. // Replace this indicator with an appropriate one that aims to improve %profitable
  45. newIndicator6 = ta.stoch(close, high, low, 14)
  46.  
  47. // Define Buy and Sell Conditions
  48. buyCondition = ta.crossover(close, upperBB) and rsiValue > 50 and atrValue > 0
  49. sellCondition = ta.crossunder(close, lowerBB) and rsiValue < 50 and atrValue > 0
  50.  
  51. // Output Buy and Sell Signals
  52. if buyCondition
  53. strategy.entry("Buy", strategy.long)
  54. if sellCondition
  55. strategy.close("Buy")
  56.  
  57. // Output the new indicators on the chart
  58. plot(newIndicator1, title="New Indicator 1", color=color.orange)
  59. plot(newIndicator2, title="New Indicator 2", color=color.green)
  60. plot(newIndicator3, title="New Indicator 3", color=color.blue)
  61. plot(newIndicator4, title="New Indicator 4", color=color.red)
  62. plot(newIndicator5, title="New Indicator 5", color=color.yellow)
  63. plot(newIndicator6, title="New Indicator 6", color=color.purple)
  64.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment