Skip to main content

Posts

Showing posts from August, 2024
Latest Crypto Fear & Greed Index


Improved Pine Script: EMA RSI Momentum

This pine script is the improved version of previous script. Check here . The strategy mainly the same, except it now has StopLoss function, so you sleep soundly knowing your capital is protected.  It also includes Start and Stop timestamp. It can be useful to backtest the strategy at a shorter/specific period of time. 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. The recent swing low acts as StopLoss level. Recommended setting: Pair: IOUSDT (Binance) Timeframe: 5 minutes Capital in wallet: Minimum 30 USDT // @version= 5 strategy ( "EMA-RSI strategy[www.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 ) // The default setting is for IOUSDT (Binance TF5) // Adjustable Inputs emaLength = input.int ( 540 , ...

My sets of favourite pine codes (for easy revision)

This post is mainly for my own reference actually, so that i could easily come back grab the lines of pine scripts to be inserted into my pine script strategy. They are all version 5 pine script. 1. Top line  Strategy with preset of initial capital, order size, and commission percentage: // @version= 5 strategy ( "Strategy Name [capayam.com]" , overlay = false , initial_capital = 100 , default_qty_type = strategy.percent_of_equity , default_qty_value = 100 , commission_type = strategy.commission.percent , commission_value = 0.1 ) 2. Input groups They are usually for adjusting Take Profit and Stop Loss level. I use this to set Oversold level as well that determine my entry threshold. // Input Groups OverboughtLevel = input.int ( 50 , title = "OverboughtLevel" ) OversoldLevel = input.int ( -50 , title = "OversoldLevel" ) 3.  Timestamp This is useful when backtesting a specified shorter period within a long period of time backtesting range (usu...