Posts

Showing posts from March, 2023

MACD crossover and EMA strategy

Image
 This simple strategy uses the MACD indicator along with the EMA trend line. For the buy signal, the strategy looks for a cross-over of the MACD line over the signal line and the price is above the 50-period EMA line.  The MACD line uses 12 and 26 periods for the MACD and 9 periods for the signal line by default. But the user can change these values. The EMA line uses a 50-period EMA. The test of the strategy was done on SQQQ only.  The script is written in Pine script and tested on Trading View. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © facelessfinance //@version=5 strategy("MACD strategy", overlay=true, initial_capital = 50000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100) // MACD Inputs input_macd_fast_line = input.int(defval = 12, title = 'MACD Fast Line', step = 1, tooltip = 'MACD Fast Line') input_macd_slow_line = input.int(defval = 26, title = '...

Simple 3 step scalping strategy in pine script

Image
 This simple scalping strategy only uses 3 steps for trading.  Find the trend: Using 20-day SMA, the strategy finds the price trend. The strategy requires the price to be above the 20-day SMA line. Right candle pattern: This strategy requires the first candle to be red, followed by two green candles. RSI: For entering a trade, this strategy requires the RSI score to be above 50. This video explains the strategy in detail, with the steps of scripting the strategy with pine script. After that, The video also shows the performance of the strategy with different input parameters. Check out the video here // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © facelessfinance //@version=5 strategy("3 step scalp", overlay=true, initial_capital = 50000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100) input_trend_period = input.int(defval = 20, title = 'Moving Average', step = 10, toolti...