Skip to main content

Posts

Showing posts from July, 2023

Heikin-Ashi Color Change with RSI Scalping Strategy

  // @version=5 strategy ( "Heikin-Ashi Color Change with RSI Scalping Strategy" , overlay = false ) // Calculate Heikin-Ashi open and close prices haOpen = ( open [ 1 ] + close [ 1 ]) / 2 haClose = ( open + high + low + close ) / 4 isColorChange = ta.change ( haClose ) > 0 // RSI rsiLength = input ( 14 , title = "RSI Length" ) rsi = ta.rsi ( close , rsiLength ) // Variables to track buy/sell conditions var bool shouldBuy = na var bool shouldSell = na // Strategy conditions shouldBuy := isColorChange and haOpen < haClose and rsi > 50 shouldSell := isColorChange and haOpen > haClose and rsi < 50 // Buy and sell orders if shouldBuy     strategy.entry ( "Buy" , strategy.long ) if shouldSell     strategy.entry ( "Sell" , strategy.short ) // Plotting Heikin-Ashi colors for visualization plotshape ( shouldBuy , title = "Buy Signal" , color = color.green , style = shape.t...

Dominant side probability

  // @version=5 indicator ( "Dominant side Probability By Vibe" , overlay = false ) // Define variables greenCount = 0 redCount = 0 // Calculate RSI rsiLength = input ( 14 , title = "RSI Length" ) rsi = ta.rsi ( close , rsiLength ) // Calculate Volume Moving Average volLength = input ( 20 , title = "Volume MA Length" ) volMa = ta.sma ( volume , volLength ) // Loop through historical data for i = 1 to 100     if close [ i ] > close [ i -1 ] and rsi [ i ] > 50 and volume [ i ] > volMa [ i ]         greenCount := greenCount + 1     else if close [ i ] < close [ i -1 ] and rsi [ i ] < 50 and volume [ i ] > volMa [ i ]         redCount := redCount + 1 // Calculate probabilities totalCount = greenCount + redCount greenProbability = greenCount / totalCount * 100 redProbability = redCount / totalCount * 100 // Plot probabilities plot ( greenProbability ...