Pinescript Code for Hilega Milega
Strategy and image Credit: NK@StockTalk
//@version=3
// © ObserveNifty
study("Hilega Milega Strategy by @ObserveNifty", overlay=true)
//length_RSI = input(9)
priceRSI = close
rsi = rsi(priceRSI, 9)
wma_rsi = wma(rsi, 21)
ema_rsi = ema(rsi, 3)
vwap_close = vwap(close)
// Deternine if we are currently LONG
isLong = false
isLong := nz(isLong[1], false)
// Determine if we are currently SHORT
isShort = false
isShort := nz(isShort[1], false)
// buytrigger = not isLong and crossover(vrsi14,50) and crossover(vrsi5,70)
buytrigger = not isLong and wma_rsi < ema_rsi and wma_rsi > 50 and close > vwap_close
plotshape(buytrigger, title="Buy Signal Generated", text="Buy", textcolor=white, style=shape.labeldown, location=location.abovebar, color=red, transp=0, size=size.tiny)
buyExit = isLong and (wma_rsi > ema_rsi or wma_rsi <= 50 or close < vwap_close)
plotshape(buyExit, title="Exit Buy", text="Exit Buy", textcolor=white, style=shape.labeldown, location=location.abovebar, color=red, transp=0, size=size.tiny)
if (buytrigger)
isLong := true
isShort := false
if (buyExit)
isLong := false
isShort := false
//sellTrigger = not isShort and crossunder(vrsi14,50) and crossunder(vrsi5,30)
sellTrigger = not isShort and wma_rsi > ema_rsi and wma_rsi > 50 and close < vwap_close
plotshape(sellTrigger, title="Sell Signal Generated", text="SELL", textcolor=white, style=shape.labelup, location=location.belowbar, color=red, transp=0, size=size.tiny)
sellExit = isShort and (wma_rsi < ema_rsi or wma_rsi <= 50 or close > vwap_close)
plotshape(sellExit, title="Exit SELL", text="Exit SELL", textcolor=white, style=shape.labelup, location=location.belowbar, color=red, transp=0, size=size.tiny)
if (sellTrigger)
isLong := false
isShort := true
if (sellExit)
isLong := false
isShort := false
Enjoy Coding
Please make auto buy and sell script....
ReplyDeleteThis script shows signal
Make script of same for auto bying and exit of buy or auto selling and exiting trade for algo softwere...or else make algo trading softwere of it ..we will buy it from you...thanks....
Hi, may I know what time frame are you following for the script? As there are lot of false signals. I may have an idea to fix it. If you would want to connect on @badaljoshi that is my Telegram id
ReplyDeletePlease add buying price in buy indicator signal
ReplyDeleteAnd selling price in sell signal....
It show only buy and sell
It should shoe buy 120 sell 150 like this
please can you edit HM pine scriptthis lable showing buy... example=buy ;1230 and exit sell ;1280 this way.....so that we will get price at the time of the indicator crossing
ReplyDelete