Skip to main content
Latest Crypto Fear & Greed Index


Whale Signal with Start Stop Timestamp

This new pine script code is revision of previous Buy-on-Whale-signal pine script. It has start-stop time setting. This function is there for 2 reasons:

1. If you are using 'Percentage' as 'Order Size' in the Properties setting, u will need to set START DATE on the day u start running the bot (SUPER IMPORTANT!). Otherwise, u may be getting a lot of error on placing order.

2. It is useful if  you need to test a strategy on shorter backtesting range on longer timeframe chart (ie. lets say u want to see how the bot performs during bearish period). This feature is not needed if you are subscriber to Tradingview Pro. 


Strategy Description: It places buy order when then whale detector bar reaches certain threshold level which you can adjust as well as the Take Profit and Stop Loss. And Set when to start and stop trading range.

Recommended Settings:

Pair: BTCUSDT (Binance)

Time frame: 7min

Initial Capital: 10

Base Currency: Default

Order Size: 10 USDT

Pyramiding: 1 order

Commission: 0.1 % 

*credit to BLACKCAT1404   


//@version=4
strategy("WHALE Signal START-STOP [www.capayam.com, credit to Blackcat1404]", overlay=false, commission_type=strategy.commission.percent , commission_value=0.1)

// Tested on BTCUSDT (Binance) TF 7minute

// Input parameters
whale_threshold = input(30, title="Whale Threshold")
profit_target_percent = input(6, title="Profit Target (%)")
stop_loss_percent = input(3, title="Stop Loss (%)")
scale = input(1000, title="Scale Factor")
show_whale = input(true,title = "Show Whale detector")

start_year = input(2024, title="Start Year", minval=2000, maxval=2100)
start_month = input(6, title="Start Month", minval=1, maxval=12)
start_day = input(1, title="Start Day", minval=1, maxval=31)

stop_year = input(2024, title="Stop Year", minval=2000, maxval=2100)
stop_month = input(12, title="Stop Month", minval=1, maxval=12)
stop_day = input(31, title="Stop Day", minval=1, maxval=31)

// Create timestamps from the input dates
start_trading_date = timestamp(start_year, start_month, start_day, 0, 0)
stop_trading_date = timestamp(stop_year, stop_month, stop_day, 23, 59)


///WHALE BY BLACKCAT1404

//functions
xrf(values, length) =>
    r_val = float(na)
    if length >= 1
        for i = 0 to length by 1
            if na(r_val) or not na(values[i])
                r_val  :=  values[i]
                r_val
    r_val

xsa(src,len,wei) =>
    sumf = 0.0
    ma = 0.0
    out = 0.0
    sumf  :=  nz(sumf[1]) - nz(src[len]) + src
    ma  :=  na(src[len]) ? na : sumf/len
    out  :=  na(out[1]) ? ma : (src*wei+out[1]*(len-wei))/len
    out

//trend follower algorithm
var2 = xrf(low,1)
var3 = xsa(abs(low-var2),3,1)/xsa(max(low-var2,0),3,1)*100
var4 = ema(iff(close*1.2,var3*10,var3/10),3)
var5 = lowest(low,30)
var6 = highest(var4,30)
var7 = iff(lowest(low,58),1,0)
var8 = ema(iff(low<=var5,(var4+var6*2)/2,0),3)/618*var7

//plotcandle(0,var8 * (close/scale) ,0,var8* (close/scale),color= var8 > 0 and show_whale ?color.yellow:na)

plot(show_whale? var8 * (close/scale) : na, title = "whale" , style = plot.style_columns,color=color.yellow, transp=80)


    // Define whale pump condition
whale_pump_condition = var8 * (close/scale) > whale_threshold and (time >= start_trading_date) and (time <= stop_trading_date)

// Strategy logic
if (whale_pump_condition)
    strategy.entry("Buy", strategy.long)
   
// Calculate profit target and stop loss levels
entry_price = strategy.position_avg_price
profit_target = entry_price * (1 + profit_target_percent / 100)
stop_loss = entry_price * (1 - stop_loss_percent / 100)

// Exit conditions
strategy.exit("TP/SL", limit=profit_target, stop=stop_loss)

*please feel free to drop your strategy setting in the comment section.

*this whale strategy is too good that i have not been able to curate other better strategy in the past 1 month.

Comments

Popular posts from this blog

New Pine Scipt: Martingale Strategy

This script actually does not really involve any Technical Analysis (TA). It just a bot that runs on traditional martingale strategy. Martingale startegy is a risk management strategy that originated in 18th-century France. It is based on the principle of doubling down on losses to recover them in the next winning trade. Strategy description: It places BUY order and double down (according to the multiplier) when the price got lower. TP as per your setting. This strategy works best during bearish period with recovery pattern. Recommended setting: Pair: SUIUSDT (Binance) Time frame:  5min Min capital in wallet:  168 USDT   The code as follows:  **Please read the important instruction in the code. // @version= 5 strategy ( "SUI(Binance TF5)www.capayam.com" , overlay = false , initial_capital = 168 , default_qty_type = strategy.percent_of_equity , default_qty_value = 100 , pyramiding = 10 , commission_type = strategy.commission.percent , commission_value = 0....

New Pine Script Published: EMA RSI Momentum Strategy

 This is a momentum strategy that strikes while its hot and exits before the momentum ended. It is actually quite by using only 2 indicators which Exponential Moving Average (EMA) and Relative Strength Index (RSI).  Strategy Technical Description: It place Buy order when price crosses up EMA line and RSI is above BUY threshold. It exits when the RSI reaches SELL threshold. Recommended setting: Pair: RNDR (Binance) Timeframe: 5 minutes Order Size: 100% equity Pyramiding: 1 order Commission: 0.1 % // @version= 5 strategy ( "EMA RSI Momentum Strategy TF5min [capayam.com]" , overlay = false , initial_capital = 10 , default_qty_type = strategy.percent_of_equity , default_qty_value = 100 , commission_type = strategy.commission.percent , commission_value = 0.1 ) //Desc: Buys when price crosses above long EMA line and above RSI Buy threshold. Exits when RSI above Sell threshold. //Recomended pair: RNDRUSDT TF5min (Binance) // Adjustable Inputs emaLength = input.int ( 450 ,...

New Pine Script Stratgey: Buy on Whale Signal

This strategy is adapted from an indicator Whale detector, which is thanks to BLACKCAT1404, the curator of the indicator.  Startegy Description: It places buy order when then whale detector bar reaches certain threshold level which you can adjust as well as the Take Profit and Stop Loss. Recommended Settings: Pair: BTCUSDT (Binance) Time frame: 7min Initial Capital: 10 Base Currency: Default Order Size: 10 USDT Pyramiding: 1 order Commission: 0.1 % Each pair of token has different threshold, suitable time frame, TP and SL. Aa a matter of fact, Even different CEX may produce result for the same coin. You have to test one by one to get the best result. Do share your best strategy setting in the comment.  *credit to  BLACKCAT1404     // @version= 4 strategy ( "WHALE pump signal [www.capayam.com, credit to Blackcat1404]" , overlay =false, commission_type = strategy.commission.percent , commission_value = 0.1 ) // Desc: Best setting ETH TF7min Thres 30 TP6 SL3 Sc...