Can someone please help me create an alert for this strategyHave tried a few different methods but just constantly get errors in different lines of code......been trying for hours *sigh*. Any help would be so greatly appreciated
Long when rsi overbought,
close trade when rsi oversold and < Vstop
//@version=3
strategy("Vstop and RSI", overlay=true)
//RSI Section
length = input(2, "RSI Period")
overSold = input(30, "Oversold Level")
overBought = input(70, "Overbought Level")
price = close
vrsi = rsi (price, length)
//VSTOP Section
vlength = input(2, "Vstop Length")
mult = input(2, "Vstop Mult")
atr_ = atr(vlength)
max1=0.0
min1=0.0
is_uptrend_prev = false
stop=0.0
vstop_prev=0.0
vstop1=0.0
is_uptrend=false
is_trend_changed=false
max_ = 0.0
min_ = 0.0
vstop=0.0
max1 := max(nz(max_ ), close)
min1 := min(nz(min_ ), close)
is_uptrend_prev := nz(is_uptrend , true)
stop := is_uptrend_prev ? max1 - mult * atr_ : min1 + mult * atr_
vstop_prev := nz(vstop )
vstop1 := is_uptrend_prev ? max(vstop_prev, stop) : min(vstop_prev, stop)
is_uptrend := close - vstop1 >= 0
is_trend_changed := is_uptrend != is_uptrend_prev
max_ := is_trend_changed ? close : max1
min_ := is_trend_changed ? close : min1
vstop := is_trend_changed ? is_uptrend ? max_ - mult * atr_ : min_ + mult * atr_ : vstop1
plot(vstop, color = is_uptrend ? green : red, style=cross, linewidth=2)
if vrsi > overBought
strategy.entry("Buy", strategy.long, comment="Buy")
if vrsi < overSold and vstop > price
strategy.entry("Sell", strategy.short, comment="Sell")
Osilatörler
SB_RSI/MFI with Volatility Version 1.0Take on LazyBear's SB_RSI/MFI with Volatility Indicator.
The original indicator is coupled with the Bollinger Band strategy.
Original Idea:
Wanted to test the indicator with bbstrategy.
Message if you think of any modifications/ enhancements/ any opportunities. :)
Donations/Tips... :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
SB_Compliment_RSI StrategyThe strategy modifies the original rsi strategy with the addition of compliment si (i.e. 100-rsi).
Strategy Idea: Previous rsi high and low value is recorded when the rsi crosses overBought(70) and OverSold(30) values.
Now when the rsi crosses above the overSold range, the rsi is matched with the compliment of previous high rsi value. If the compliment i.e.(100-prev_rsi_high) is less than or equal to rsi then long position is taken.
For short position, when the rsi crosses below the overBought range, the rsi is matched with the compliment of previous low rsi value. If compliment i.e.(100-prev_rsi_low) is greater than or equal to rsi.
Below s the code for the indicator present in the chart.
//@version=3
study(title="SB_Compliment_Relative Strength Index", shorttitle="RSI")
src = close, len = input(14, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, color=purple)
plot(100-rsi, color=orange)
band1 = hline(70)
band0 = hline(30)
fill(band1, band0, color=purple, transp=90)
The code also has switch code also which means it will enter the overBrought or overSold block one after the other.
Future modifications: Currently the value of rsi tracked is the one in which it crosses the overSold or OverBought range and not the highest/lowest value when the value is above/below OverBought/OverSold range.
Comment the perfect combination of indicators for it and will try to incorporate those indicators into it in the next version.
Message if you think of any modifications/ enhancements/ any opportunities. :)
Donations/Tips... :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
SB_CM_RSI_2_Strategy_Version 2.0(New: Profit booking present which is not present in the previous indicator)
The strategy is based on the indicator posted by @ChrisMoody "CM RSI-2 Strategy Lower Indicator" which is based on "Larry Connors RSI-2 Strategy - Lower RSI"
In this strategy, the longs are placed when a green color is encountered in the rsi in the previous candle and short when the red color is encountered in the rsi.
Although the profits are booked when the rsi crossover the 10 level mark or crossunder the 90 level mark.
Just message in the script if you have any different idea regarding this indicator.
For the original indicator you can refer to :
For Tips to continue :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
SB_CM_RSI_2_Strategy_Version 1.0The strategy is based on the indicator posted by @ChrisMoody "CM RSI-2 Strategy Lower Indicator" which is based on "Larry Connors RSI-2 Strategy - Lower RSI"
In this strategy the longs are placed when a green color is encountered in the rsi and short when red color is encountered in the rsi.
Although the profits can be booked at different interval.
Just message in the script if you have any different idea regarding this indicator.
For the original indicator you can refer to :
For Tips to continue :) :
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
XBT Weekend Trade Strategy - 10x leverage and pyramiduses 10x leverage
Using Friday's XBT close price do the following:
- Go short when price rises above 4.5%
- Go long when price falls below 4.5%
- Add to long position when price falls another 4.5%, same with short position on the rise
- Close all orders when profits reach 10%
- Allow stacking up to 2 orders at once
- Close all orders start of Monday
XBT Weekend Trade Strategy (10x leverage)Using 10x leverage
Using Friday's GXBT close price do the following:
- Go short when price rises above 4.5%
- Go long when price falls below 4.5%
- Close all orders when profits reach 10%)
- Close all orders start of Monday
SB_Wavetrend_OscillatorA take on LazyBear's Wavetrend_Oscillator
The idea is bit modified.
Original Idea:
When the oscillator is above the overbought band (red lines) and crosses down the signal (dotted line), it is usually a good SELL signal. Similarly, when the oscillator crosses above the signal when below the Oversold band (green lines), it is a good BUY signal.
Modified Idea:
Carrying the original idea, if the oscillator crosses the overbought band (red lines) and crosses down the signal (dotted line) twice without crossing the Oversold band (green lines) and crosses above the signal (dotted line), a buy or sell signal will take place when the oscillator crosses the dotted line and the value of oscillator is >0(if sell order is to be placed) and <0(if buy order is to be placed).
For the original idea you can refer to:
Let me know if any refinements could improve the oscillator.
SD_Bull_Bear_Engulfing_Rsi_SdThis strategy combines the idea of a bullish or bearish candle engulfing coupled with standard deviation (a 100% increase or a 50% decrease). The exit condition is placed if the percentage increase is achieved or 35<rsi<65.
The strategy requires refinement so please test the script and let know what can be incorporated to improve the efficiency.
RSI-candlestick StrategyThe script follows a modified rsi strategy and orders are placed if a candlestick pattern is identified in the current or previous candle.
(For optimized results you can add or remove the strategy entry and exits based on the chart you wish to apply the script to).
function bugFunctions with parameters do not work correctly: the returned value is sometimes different from the expected one.
The example script works correctly only when idx = 1 (instead of the current line 6).
LinearRegressionChannelBreakoutMy first idea about the linear regression channel... It is free and available for everybody.
Pramod’s Intraday StrategyIf Open = High, Short with 0.25% Stop Loss and 0.5% Take Profit
If Open = Low, Long with 0.25% Stop Loss and 0.5% Take Profit
This strategy is given by desipplz.
Parabolic SAR Strategy with good parametersI tested it on EURUSD with 2% profit:
Set input parameters like here: screenshots.firefox.com
Test1 based on Awesome and MACD oscillatorIf you know how to set stop-loss and take-profit limit based on prices, not tick, please comment.
Thanks!!
First script to be optimizedPlease, if you can help me to set stop-loss and take-profit rules based on prices and not on ticks, please comment that!
RSI Strategy - TannerHello everyone, this is my first script on TV. I have done some research on cryptocurrency strategies and much of which has been in technical indicators by combining trend and momentum analysis together. Pine Script is quite a difficult language to learn as opposed to Python.
Anyways, I made some adjustments for the RSI strategy to include a stop loss/take profit and added indicators upon the first initial overbought and oversold levels(70 and 30 respectively). Please DO give me advice or recommendations. Primarily, I am confused as to what metric the stop loss and take profit parameters are using as they do not change when the values are changed in the input. I am unable to tell whether the strategy repaints. Could someone explain why repainting typically occurs in crossovers?
*DISCLAIMER*
This script is merely to help myself and others learn about the Pine Script language. I would not advise you to use this script for live trading. Thanks!
Trend following with HAThis is my first script and it is basically a MA crossover/under strategy that uses heikin ashi closing prices. I've also used limit orders based on HA opening prices of the previous day for entry which improves the performance. However, this impose a restriction when prices are moving too fast and the algo is unable to enter the trade, resulting in a bad position for a long period, which I believe is preventing this strategy from performing better. Will appreciate any comments/ suggestions to improve this (such as enter market prices the next day when failed to enter on HA price - not sure if this is possible) as I'm still starting out and will be more than happy to learn from the community here. Cheers!