WMA + MACD strategy with trailing stopHi!
That's my first strategy. I already learn pine, so i will work on it more. Now i search how to make trailing stop working.
"WMA + MACD strategy with traiing stop" is very simple strategy which is designated for stocks market. It is created only to take long positions.
Buy signal is when WMA(120) is below price and macd(10,20,10) histogram is higher than 0.
Position should be automaticly closed when price hits stoploss level.
One transaction should be max 20% of our capital and stoploss is set 3% lower than last closing price.
Centered Oscillators
kurdistan MACD & RSI & EMA Hello friends
This indicator can help you to combine the three indicators together
EMA (20), MACD (12, 26, 20), RSI (14)
Apply ema20 to rsi as the signal line
Long arrival time
Price above EMA20, MACD above signal line and RSI above signal line
Short arrival time
Price below EMA20, MACD below signal line and RSI below signal line
Combo Backtest 123 Reversal & DiNapoli Detrended Oscillator This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
DiNapoli Detrended Oscillator Strategy
WARNING:
- For purpose educate only
- This script to change bars colors.
Best Supertrend CCI StrategyHello traders
Someone requested the strategy version of the Supertrend CCI indicator
It's a Supertrend not based on candle close but based on a CCI ( Commodity Channel Index )
How does it work?
Bull event: CCI crossing over the 0 line
Bear event: CCI crossing below the 0 line
When the event is triggered, the script will plot the Supertrend as follow
UP Trend = High + ATR * Factor
DOWN Trend = Low - ATR * Factor
This is an alternative of the classical Supertrend based on candle close being above/beyond the previous Supertrend level.
Hope you'll enjoy it and it will improve your trading making you a better trader
Dave
HA smoothed eliminator v2 This script is published to show the difference between Heiken ASHI and Japanese candlesticks. I do not recommend using it in trading. the indicator is taken from here
MACD_RSI strategyUse three indicator to entry a position
EMA (20), MACD (12, 26, 20), RSI (14)
apply ema20 on rsi as signal line
Entry long when
price above EMA20, MACD above signal line and RSI above signal line
Entry short when
price below EMA20, MACD below signal line and RSI below signal line
Study only, use it under your own risk.
Darvas Box Strategy V2What Is the Darvas Box?
The Darvas Box strategy was developed by Nicholas Darvas. Aside from being a well known dancer, he began trading stock in the 1950s. Based on his success in trading, he was approached to write a book on his strategy. The book, “How I Made $2,000,000 in the Stock Market,” outlines his rather simple approach … simple once you understand the basic concepts and rationale of the strategy.
Darvas originally started with $10,000. He was willing to plunk the whole amount into one stock. This is because he always used a stop loss to control risk, so the whole amount of capital was not fully in jeopardy. As his capital grew, he would allocate capital to various stocks.
Darvas Box Strategy
As the name implies, Darvas Box is based on boxes that a price was trading in. For example, if the price is moving between $45 and $50, that is a box. Mr. Darvas’s goal was to only buy stocks that were moving into higher and higher boxes.
If the price moved above $50, to $50.50, Mr. Darvas bought the stock because it was now moving into a higher box. If the price dropped below $45 (of the $45 to $50 box), to $44.50, then the stock was moving down a box, and therefore was negated as a purchase candidate.
The box limit is not set, but is determined by market forces. If the price is moving between $47 and $48, that creates a box. If it moves higher, the next box may be between $50 and $53, which is the next point where the price stalls and moves back and forth.
A price can stay in a box for as long as it wants. As long as it doesn’t drop below the low of the box, it remains a buy candidate if it moves above the upper limit of the box.
Mr. Darvas gives the following example in his book, of a stock breaking higher into a new box:
If the stock acted right, it started to push from its 45/50 box into another, upper box. Then its movement began to read something like this: 48 – 52 – 50 – 55 – 51 – 50 – 53 – 52.
It has now quite clearly establishing itself in its next box—the 50/55 box.
Darvas Box is an indicator that simply draws lines along highs and lows, and then adjusts them as new highs and lows form. The indicator is available on many trading platforms, such as Thinkorswim. Traders may wish to draw their own boxes though, based on recent highs and lows; Darvas was able to do so (based on telegram quotes) more than half a century ago.
Darvas Box Rules
Darvas established some rules, not just for his strategy, but for himself. After going though his initial learning period of subscribing to a whole bunch of “advisory services,” he found that none of them worked, and they often contradicted each other. Therefore, he proposed seven basic rules to impose on himself.
The following are summarized from his book.
I shall not follow advisory services.
I shall be cautious of broker advice.
I shall ignore Wall Street sayings or truisms, no matter how ancient or revered.
I shall only trade stocks on major exchanges with adequate volume .
I shall not listen to (or trade off of) rumors or tips, no matter how well researched they may sound.
I will use a sound strategy instead of gamble…I must study this strategy (originally this approach was fundamental analysis , which didn’t work for him, so he developed his Darvas Box trading method).
I will hold one position for longer, as opposed to juggling a bunch of positions for a short period of time.
See also 7 Rules Every Contrarian Investor Must Follow
These rules helped Nicholas Darvas develop his strategy, and have the discipline to stick to it. The basic Darvas Box strategy rules are as follows:
Darvas looked for increasing volume when selecting stocks to trade; this alerted him to stocks that were being accumulated and were likely to see strong trends.
Darvas believed in buying stocks that presented an upper box limit breakout, but also had an upward Earnings trend. This was especially the case when the major indexes had experienced a decline.
When an upper box limit is broken, buy. From his book, the entry price was usually about 1 to 2% above the upper box limit.
If you enter a trade and the price proceeds to drop out of the new box, and back into the old box, exit the trade.
Entry and stop loss orders should be set in advance, so trades aren’t missed and risk is controlled.
Place, and trail the stop loss order to below the low of the most recent box. This initial stop loss was pretty tight, because Darvas assumed when a price broke out of an old box, it was entering a new box. Therefore, the stop was placed just below the high of old box which was just broken (low of new box).
Record trades, including reasons why you entered and exited.
General conditions of the market must favor buying. Don’t buy stocks when the major indexes are in a bear market, or when volume is flat or declining.
If you are stopped out, but the price moves back into the higher box again providing another buy signal, buy again, using the same stop loss location.
Since the stop is being trailed up, more funds can be added on each consecutive breakout.
Risks and Considerations
During choppy market conditions the strategy is likely to produce many small losses in a row. This is a trend following method, so a trend needs to develop to produce a profit.
Based on his book, the initial stop loss was set just below the breakout price (likely low of the new box). It was then trailed up as new boxes formed. This method takes a lot of discipline, and a trader can’t get emotionally attached to a stock. Buy and sell when the signals say so.
Traders also need the intestinal fortitude to get back into a trade, if the signals say so, even if they were stopped out. Darvas also added to positions as breakouts to higher boxes occurred. This means bigger gains on trades that work out, but if the trend doesn’t continue, adding to positions near (what ends up being) the top of a move can work against you.
The method could also be employed using short selling when the boxes are dropping. An entry occurs when the price moves below the lower limit of the box; a stop is placed just above the entry price (in the old box) and then trailed down above the top of new lower boxes.
A stop loss won’t save you from losing more than expected if the price gaps through your order. Consider this when assessing how much capital you are willing to commit to a stock.
traderhq.com
Note : Sorry an error occurred in the first version, i installed the second version (security(syminfo.tickerid, 'D', high)v4 not working in different time periods
Tradingview Screener 52 Week High Low
52 Week High Low
Darvas Box StrategyWhat Is the Darvas Box?
The Darvas Box strategy was developed by Nicholas Darvas. Aside from being a well known dancer, he began trading stock in the 1950s. Based on his success in trading, he was approached to write a book on his strategy. The book, “How I Made $2,000,000 in the Stock Market,” outlines his rather simple approach … simple once you understand the basic concepts and rationale of the strategy.
Darvas originally started with $10,000. He was willing to plunk the whole amount into one stock. This is because he always used a stop loss to control risk, so the whole amount of capital was not fully in jeopardy. As his capital grew, he would allocate capital to various stocks.
Darvas Box Strategy
As the name implies, Darvas Box is based on boxes that a price was trading in. For example, if the price is moving between $45 and $50, that is a box. Mr. Darvas’s goal was to only buy stocks that were moving into higher and higher boxes.
If the price moved above $50, to $50.50, Mr. Darvas bought the stock because it was now moving into a higher box. If the price dropped below $45 (of the $45 to $50 box), to $44.50, then the stock was moving down a box, and therefore was negated as a purchase candidate.
The box limit is not set, but is determined by market forces. If the price is moving between $47 and $48, that creates a box. If it moves higher, the next box may be between $50 and $53, which is the next point where the price stalls and moves back and forth.
A price can stay in a box for as long as it wants. As long as it doesn’t drop below the low of the box, it remains a buy candidate if it moves above the upper limit of the box.
Mr. Darvas gives the following example in his book, of a stock breaking higher into a new box:
If the stock acted right, it started to push from its 45/50 box into another, upper box. Then its movement began to read something like this: 48 – 52 – 50 – 55 – 51 – 50 – 53 – 52.
It has now quite clearly establishing itself in its next box—the 50/55 box.
Darvas Box is an indicator that simply draws lines along highs and lows, and then adjusts them as new highs and lows form. The indicator is available on many trading platforms, such as Thinkorswim. Traders may wish to draw their own boxes though, based on recent highs and lows; Darvas was able to do so (based on telegram quotes) more than half a century ago.
Darvas Box Rules
Darvas established some rules, not just for his strategy, but for himself. After going though his initial learning period of subscribing to a whole bunch of “advisory services,” he found that none of them worked, and they often contradicted each other. Therefore, he proposed seven basic rules to impose on himself.
The following are summarized from his book.
I shall not follow advisory services.
I shall be cautious of broker advice.
I shall ignore Wall Street sayings or truisms, no matter how ancient or revered.
I shall only trade stocks on major exchanges with adequate volume.
I shall not listen to (or trade off of) rumors or tips, no matter how well researched they may sound.
I will use a sound strategy instead of gamble…I must study this strategy (originally this approach was fundamental analysis, which didn’t work for him, so he developed his Darvas Box trading method).
I will hold one position for longer, as opposed to juggling a bunch of positions for a short period of time.
See also 7 Rules Every Contrarian Investor Must Follow
These rules helped Nicholas Darvas develop his strategy, and have the discipline to stick to it. The basic Darvas Box strategy rules are as follows:
Darvas looked for increasing volume when selecting stocks to trade; this alerted him to stocks that were being accumulated and were likely to see strong trends.
Darvas believed in buying stocks that presented an upper box limit breakout, but also had an upward Earnings trend. This was especially the case when the major indexes had experienced a decline.
When an upper box limit is broken, buy. From his book, the entry price was usually about 1 to 2% above the upper box limit.
If you enter a trade and the price proceeds to drop out of the new box, and back into the old box, exit the trade.
Entry and stop loss orders should be set in advance, so trades aren’t missed and risk is controlled.
Place, and trail the stop loss order to below the low of the most recent box. This initial stop loss was pretty tight, because Darvas assumed when a price broke out of an old box, it was entering a new box. Therefore, the stop was placed just below the high of old box which was just broken (low of new box).
Record trades, including reasons why you entered and exited.
General conditions of the market must favor buying. Don’t buy stocks when the major indexes are in a bear market, or when volume is flat or declining.
If you are stopped out, but the price moves back into the higher box again providing another buy signal, buy again, using the same stop loss location.
Since the stop is being trailed up, more funds can be added on each consecutive breakout.
Risks and Considerations
During choppy market conditions the strategy is likely to produce many small losses in a row. This is a trend following method, so a trend needs to develop to produce a profit.
Based on his book, the initial stop loss was set just below the breakout price (likely low of the new box). It was then trailed up as new boxes formed. This method takes a lot of discipline, and a trader can’t get emotionally attached to a stock. Buy and sell when the signals say so.
Traders also need the intestinal fortitude to get back into a trade, if the signals say so, even if they were stopped out. Darvas also added to positions as breakouts to higher boxes occurred. This means bigger gains on trades that work out, but if the trend doesn’t continue, adding to positions near (what ends up being) the top of a move can work against you.
The method could also be employed using short selling when the boxes are dropping. An entry occurs when the price moves below the lower limit of the box; a stop is placed just above the entry price (in the old box) and then trailed down above the top of new lower boxes.
A stop loss won’t save you from losing more than expected if the price gaps through your order. Consider this when assessing how much capital you are willing to commit to a stock.
traderhq.com
Tradingview Screener 52 Week High Low
52 Week High Low
HatiKO EnvelopesPublished source code is subject to the terms of the GNU Affero General Public License v3.0
This script describes and provides backtesting functionality to internal strategy of algorithmic crypto trading software "HatiKO bot".
Suitable for backtesting any Cryptocurrency Pair on any Exchange/Platform, any Timeframe.
Core Mechanics of this strategy are based on theory of price always returning to Moving Average + Envelopes indicator (Moving_average_envelope from Wiki)
Developement of this script and trading software is inspired by:
"Essential Technical Analysis: Tools and Techniques to Spot Market Trends" by Leigh Stevens (published on 12th of April 2002)
"Moving Average Envelopes" by ChartSchool, StockCharts platform (published on 13th of April 2015 or earlier)
"Коля Колеснік" from Crypto Times channel ("Метод сетка", published on 19th of August 2018)
"3 ways to use Moving Average Envelopes" by Rich Fitton, published on Trader's Nest (published on 28st of November 2018 or earlier)
noro's "Robot WhiteBox ShiftMA" strategy v1 script, published on TradingView platform (published on 29th of August 2018)
"Moving Average Envelopes: A Popular Trading Tool" Investopedia article (published 25th of June 2019)
and KROOL1980's blogpost on Argolabs ("Гридерство или Сетка как источник прибыли на форекс", published on 27th of February 2015)
Core Features:
1) Up to 4 Envelopes in each direction (Long/Short)
2) Use any of 6 different basis MAs, optionally use different MAs for Opening and Closure
3) Use different Timeframes for MA calculation, without any repainting and lookahead bias.
4) Fixed order size, not Martingale strategy
5) Close open position earlier by using Deviation parameter
6) PineScript v4 code
Options description:
Lot - % from your initial balance to use for order size calculation
Timeframe Short - Timeframe to use for Short Opening MA calculation, can be chosen from dropdown list, default is Current Graph Timeframe
MA Type Short - Type of MA to use for Short Opening MA calculation, can be chosen from dropdown list, default is SMA
Data Short - Source of Price for Short Opening MA calculation, can be chosen from dropdown list, default is OHLC4
MA Length Short - Period used for Short Opening MA calculation, should be >=1, default is 3
MA offset Short - Offset for MA value used for Short Envelopes calculation, should be >= 0, default is 0
Timeframe Long - Timeframe to use for Long Opening MA calculation, can be chosen from dropdown list, default is Current Graph Timeframe
MA Type Long - Type of MA to use for Long Opening MA calculation, can be chosen from dropdown list, default is SMA
Data Long - Source of Price for Long Opening MA calculation, can be chosen from dropdown list, default is OHLC4
MA Length Long - Period used for Long Opening MA calculation, should be >=1, default is 3
MA offset Long - Offset for MA value used for Long Envelopes calculation, should be >= 0, default is 0
Mode close MA Short - Enable different MA for Short position Closure, default is "false". If false, Closure MA = Opening MA
Timeframe Short Close - Timeframe to use for Short Position Closure MA calculation, can be chosen from dropdown list, default is Current Graph Timeframe
MA Type Close Short - Type of MA to use for Short Position Closure MA calculation, can be chosen from dropdown list, default is SMA
Data Short Close - Source of Price for Short Closure MA calculation, can be chosen from dropdown list, default is OHLC4
MA Length Short Close - Period used for Short Opening MA calculation, should be >=1, default is 3
Short Deviation - % to move from MA value, used to close position above or beyond MA, can be negative, default is 0
MA offset Short Close - Offset for MA value used for Short Position Closure calculation, should be >= 0, default is 0
Mode close MA Long - Enable different MA for Long position Closure, default is "false". If false, Closure MA = Opening MA
Timeframe Long Close - Timeframe to use for Long Position Closure MA calculation, can be chosen from dropdown list, default is Current Graph Timeframe
MA Type Close Long - Type of MA to use for Long Position Closure MA calculation, can be chosen from dropdown list, default is SMA
Data Long Close - Source of Price for Long Closure MA calculation, can be chosen from dropdown list, default is OHLC4
MA Length Long Close - Period used for Long Opening MA calculation, should be >=1, default is 3
Long Deviation - % to move from MA value, used to close position above or beyond MA, can be negative, default is 0
MA offset Long Close - Offset for MA value used for Long Position Closure calculation, should be >= 0, default is 0
Short Shift 1..4 - % from MA value to put Envelopes at, for Shorts numbers should be positive, the higher is number, the higher should be Shift position, example: "Shift 1 = 1, shift 2 = 2, etc."
Long Shift 1..4 - % from MA value to put Envelopes at, for Longs numbers should be negative, the lower is number, the lower should be Shift position, example: "Shift 1 = -1, shift 2 = -2, etc."
From Year 20XX - Backtesting Starting Year number, only 20xx supported as script is cryptocurrency-oriented.
To Year 20XX - Backtesting Final Year number, only 20xx supported as script is cryptocurrency-oriented.
From Month - Years starting Month, optional tweaking, changing not recommended
To Month - Years ending Month, optional tweaking, changing not recommended
From day - Months starting day, optional tweaking, changing not recommended
To day - Months ending day, optional tweaking, changing not recommended
Graph notes:
Green lines - Long Envelopes.
Red lines - Short Envelopes.
Orange line - MA for closing of Short positions.
Lime line - MA for closing of Long positions.
**************************************************************************************************************************************************************************************************************
Опубликованный исходный код регулируется Условиями Стандартной Общественной Лицензии GNU Affero v3.0
Этот скрипт описывает и предоставляет функции бектеста для внутренней стратегии алгоритмического программного обеспечения "HatiKO bot".
Подходит для тестирования любой криптовалютной пары на любой бирже/платформе, на любом таймфрейме.
Кор-механика этой стратегии основана на теории всегда возвращающейся к значению МА цены с использованием индикатора Envelopes (Moving_average_envelope from Wiki)
Разработка этого скрипта и программного обеспечения для торговли вдохновлена следующими источниками:
Книга "Essential Technical Analysis: Tools and Techniques to Spot Market Trends" Ли Стивенса (опубликовано 12 апреля 2002 года)
«Moving Average Envelopes» от ChartSchool, платформа StockCharts (опубликовано 13 апреля 2015 года или раньше)
«Коля Колеснік» с канала Crypto Times («Метод сетка», опубликовано 19 августа 2018 года)
«3 ways to use Moving Average Envelopes» Рича Фиттона, опубликованные в «Trader's Nest» (опубликовано 28 ноября 2018 года или раньше)
Скрипт стратегии noro "Robot WhiteBox ShiftMA" v1, опубликованный на платформе TradingView(опубликовано 29 августа 2018 года)
«Moving Average Envelopes: A Popular Trading Tool», статья Investopedia (опубликовано 25 июня 2019 года)
Блог KROOL1980 из Argolabs («Гридерство или Сетка как источник прибыли на форекс», опубликовано 27 февраля 2015 года)
Основные особенности:
1) До 4-х Ордеров в каждом из направлении (Лонг / Шорт)
2) Выбор из 6-ти разных базовых МА, опционально используйте разные МА для открытия и закрытия.
3) Используйте разные таймфреймы для расчета MA, без перерисовки и "эффекта стеклянного шара".
4) Фиксированный размер ордера, а не стратегия Мартингейла
5) Возможность закрытия открытой позиции заблаговременно, используя параметр Deviation
6) Код реализован на PineScript v4
Описание параметров:
Lot - % от вашего первоначального баланса, используется при расчете размера Ордера
Timeframe Short - таймфрейм, используемый для расчета МА Открытия Шорт позиций, может быть выбран из списка, по умолчанию - таймфрейм текущего графика
MA Type Short - тип MA, используемый для расчета МА Открытия Шорт позиций, может быть выбран из списка, по умолчанию SMA
Data Short - источник цены для расчета МА Открытия Шорт позиций, может быть выбран из списка, по умолчанию OHLC4
MA Length Short - период, используемый для расчета МА Открытия Шорт позиций, должен быть >= 1, по умолчанию 3
MA Offset Short - смещение значения MA, используемого для расчета Шорт Ордеров, должно быть >= 0, по умолчанию 0
Timeframe Long - таймфрейм, используемый для расчета МА Открытия Лонг позиций, может быть выбран из списка, по умолчанию - таймфрейм текущего графика
MA Type Long - тип MA, используемый для расчета МА Открытия Лонг позиций, может быть выбран из списка, по умолчанию SMA
Data Long - источник цены для расчета МА Открытия Лонг позиций, может быть выбран из списка, по умолчанию OHLC4
MA Length Long - период, используемый для расчета МА Открытия Лонг позиций, должен быть >= 1, по умолчанию 3
MA Offset Long - смещение значения MA, используемого для расчета Лонг Ордеров, должно быть >= 0, по умолчанию 0
Mode close MA Short - Включает отдельное MA для закрытия Шорт позиции, по умолчанию «false». Если false, MA Закрытия = MA Открытия
Timeframe Short Close - таймфрейм, используемый для расчета МА Закрытия Шорт позиций, может быть выбран из списка, по умолчанию - таймфрейм текущего графика
MA Type Close Short - тип MA, используемый при расчете МА Закрытия Шорт позиции. Mожно выбрать из списка, по умолчанию SMA
Data Short Close - источник цены для расчета МА Закрытия Шорт позиций, может быть выбран из списка, по умолчанию OHLC4
MA Length Short Close - период, используемый для расчета МА Закрытия Шорт позиции, должен быть >= 1, по умолчанию 3
Short Deviation - % отклонения от значения MA, используется для закрытия позиции выше или ниже рассчитанного значения MA, может быть отрицательным, по умолчанию 0
MA Offset Short Close - смещение значения MA, используемого для расчета закрытия Шорт позиции, должно быть >= 0, по умолчанию 0
Mode close MA Long - Включает разные MA для закрытия Лонг позиции, по умолчанию «false». Если false, MA Закрытия = MA Открытия
Timeframe Long Close - таймфрейм, используемый для расчета МА Закрытия Лонг позиций, может быть выбран из списка, по умолчанию - таймфрейм текущего графика
MA Type Close Long - тип MA, используемый при расчете МА Закрытия Лонг позиции. Mожно выбрать из списка, по умолчанию SMA
Data Long Close - источник цены для расчета МА Закрытия Лонг позиций, может быть выбран из списка, по умолчанию OHLC4
MA Length Long Close - период, используемый для расчета МА Закрытия Лонг позиции, должен быть >= 1, по умолчанию 3
Long Deviation -% для перехода от значения MA, используется для закрытия позиции выше или ниже рассчитанного значения MA, может быть отрицательным, по умолчанию 0
MA Offset Long Close - смещение значения MA, используемого для расчета закрытия Лонг позиции, должно быть >= 0, по умолчанию 0
Short Shift 1..4 - % от значения MA для размещения Ордеров, для Шорт Ордеров должен быть положительным, чем выше номер, тем выше должна располагаться позиция Shift, например: «Shift 1 = 1, Shift 2 = 2 и т.д. "
Long Shift 1..4 - % от значения MA для размещения Ордеров, для Лонг Ордеров должно быть отрицательным, чем ниже число, тем ниже должна располагаться позиция Shift, например: «Shift 1 = -1, Shift 2 = -2, и т.д."
From Year 20XX - Год начала тестирования, из-за ориентированности на криптовалюты поддерживаются только значения формата 20хх.
To Year 20XX - Год окончания тестирования, из-за ориентированности на криптовалюты поддерживаются только значения формата 20хх.
From Month - Начальный месяц, опционально, менять не рекомендуется
To Month - Конечный месяц, опционально, менять не рекомендуется
From day - Начальный день месяца, опционально, менять не рекомендуется
To day - Конечный день месяца, опционально, менять не рекомендуется
Пояснения к графику:
Зеленые линии - Лонг Ордера.
Красные линии - Шорт Ордера.
Оранжевая линия - MA Закрытия Шорт позиций.
Лаймовая линия - MA Закрытия Лонг позиций.
MacD (Future Known or Unknown) StrategyThis indicator/strategy is to be used as a way to baseline the top potential any strategy could have with other strategies and indicators.
What I have created literally shows the BEST moves possible you could have made in my opinion for SHORTING or LONGING using only the MacD values of the 4 hour while on the 30 minute chart.
To use this, try checking out XBTUSD on the 30 minute chart . It will work under different time frames but works best on the 30 minute chart in my opinion. It WILL NOT WORK Above 2 hours time frame.
DO NOT TRADE WITH THIS indicator . I can't emphasize this enough. These results only work because of the lookahead_on parameter. A lot of scam indicators and strategies use this to trick people on tradingView into buying their scripts.
This code is OPEN SOURCE and as such there is nothing to hide and no scam!
I like to use this as a comparison tool for how good I 'could' have traded and at what points those were. By knowing where the perfect trading positions are, you can create real indicators and scripts that try to find patterns in those positions.
This also shows that IF you could know the direction the MacD was going what amazing results you could get ^_~.
This is meant purely for entertainment purposes and for comparing against your own scripts.
I've included the options in the settings to allow ONLY LONG or ONLY SHORTS. By default it attempts both buy attempts. You can also change your starting ($) amount and commission percentage that is taken per trade as well.
Also included in the options is the ability to set the back testing time frame to see how it performs during just certain time periods.
Finally a color explanation
Red - MacD 4 hour going down
Green - MacD 4 hour going up
Purple - MacD 4 hour going down (from an up position)
Yellow - MacD 4 hour going up (from a down position)
Notice the program will always buy right before it turns into a yellow color since it knows the future.
In the options you can turn off 'use the future' to see the horrible results if you trade the moment you know which direction the MacD 4 hour is actually going. I will revise this script in the future with attempts to work without knowing the future as play options to get better results.
If you have any questions or comments, please do not hesitate to ask!
New RenaissancePrelim version of MACD long entry and exit with custom time frame selector.
To do:
Add Stoch and Stoch RSI criteria.
RSI-VWAPBacktest script based on the previous RSI-VWAP indicator:
It's the popular RSI indicator with VWAP as a source instead of close:
- RSI_VWAP = rsi(vwap(close), RSI_VWAP_length)
What is the Volume Weighted Average Price ( VWAP )?
VWAP is calculated by adding up the dollars traded for every transaction (price multiplied by the number of shares traded) and then dividing by the total shares traded.
Trades are laddered to improve the average entry price and each entry is increased, improving the entry but increasing the risk of being liquidated.
It can be easily converted to study (alerts)
Settings for BINANCE:BTCUSDT at 30m
RSI-VWAP INDICATORThis simple indicator provides great results.
It is the popular RSI indicator with VWAP as a source instead of close.
What is the Volume Weighted Average Price (VWAP)?
VWAP is calculated by adding up the dollars traded for every transaction (price multiplied by the number of shares traded) and then dividing by the total shares traded. That is, volume.
On the Backtest, trades are laddered to improve the average entrance price.
MACD 4H StrategyThis strategy is a basic example of using MACD AND the instrument must be found an appropriate timeframe (4H recommended) before being tested with.
Multi-Oscillator Divergence StrategyNote: This is a modified version of TradingView's built-in "Divergence Indicator" and applied in "Strategy" format to show back testing results
It finds bullish and bearish divergence in a selection of well known MA formulas: MACD, RSI, STOCH, DETRENDED PRICE OSCILLATOR, MOMENTUM.
I've found good results even on 1 minute charts!
In this example the chart backtest is utilizing the detrended price oscillator (DPO)
There are multiple variables, so the ability to find good back test can sometimes be "time consuming"
And please note that if you increase "Pivot LookBack Right" variable too high, then you will increase chance of repaint. Keep this variable as low as possible
I've also drawn my own solutions on the chart (red and green trend lines) to find good take profit and safe stop loss. In order to study this properly you need the own the chart. Scripts don't give you this option.
See private chart publication link to "own" the chart for yourself. Simply click on the "Share" button (it's the megaphone icon) and click on "Make it Mine"
I've found the best approach is to create 5 copies of indicator on 1 chart and have each running with different MA formula. This will give you a majority consensus type environment.
I will post study with alert conditions next
Good luck and enjoy!
Squeeze Momentum Strategy based on Indicator [LazyBear][Bitduke]I improved Squeeze Momentum Indicator by LazyBear (momentum filter, changed data source to ohlc4) and transformed it into a strategy, adding a risk management system + ability to customize time frames for backtest.
Shortly about Squeeze Momentum Indicator:
This is a derivative of John Carter's "TTM Squeeze" volatility indicator, as discussed in his book "Mastering the Trade" (chapter 11).
Backtested on XBTUSD, ETHUSD (Bitmex). As you may notice it shows good results on 1h - 4h timeframes on these timeframes among these pairs. Relatively low drawdown ~ 12% (to date).
Combo Backtest 123 Reversal & D_Three Ten OscThis is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
TradeStation does not allow the user to make a Multi Data Chart with
a Tick Bar Chart and any other type a chart. This indicator allows the
user to plot a daily 3-10 Oscillator on a Tick Bar Chart or any intraday interval.
Walter Bressert's 3-10 Oscillator is a detrending oscillator derived
from subtracting a 10 day moving average from a 3 day moving average.
The second plot is an 16 day simple moving average of the 3-10 Oscillator.
The 16 period moving average is the slow line and the 3/10 oscillator is
the fast line.
For more information on the 3-10 Oscillator see Walter Bressert's book
"The Power of Oscillator/Cycle Combinations"
WARNING:
- For purpose educate only
- This script to change bars colors.
CCI strategy on OIL1HThis indicator is based on Commodity Channel Index.
It buys when CCI on period 200 is under -130 and it´s rising last 12 bars. It closes the position by hitting Take Profit, Stop Loss or opening short position.
It sells when CCI on period 200 is over 130 and it´s falling last 12 bars. It closes the position by hitting Take Profit, Stop Loss or opening short position.
This strategy seems to working just on USOIL on 1 hour chart. This can predict that it´s just luck and not proper strategy or indicator I would use for trading.
This script is just for educational purposes and that´s why the script is open. I will be happy if you will leave comment and try to come up with some ideas how to improve this strategy, so it can be used also on other commodities/forex pairs.
MACD Multi-MA StrategyThis script applies the average of each major MA (SMA, RMA, EMA, WVMA, WMA) to the MACD formula.
The logic is simple. When all 5 MA's are in agreement in direction, then then script will notify users of change.
I posted this as a strategy to help show how logic does in back test. If you use my simple yet effective solution to find take profit locations, you can blow this back testing out of the water!!!
To set alerts simply turn script into study
//@version=2
study(title="MACD Multi-MA Study", overlay=false)
src = close
len1 = input(8, "FAST LOOKBACK")
len2 = input(144, "SLOW LOOKBACK")
/////////////////////////////////////////////
length = len2-len1
ma = vwma(src, length)
plot(ma, title="VWMA", color=lime)
length1 = len2-len1
ma1 = rma(src, length1)
plot(ma1, title="RMA", color=purple)
length2 = len2-len1
ma2 = sma(src, length2)
plot(ma2, title="SMA", color=red)
length3 = len2-len1
ma3 = wma(src, length3)
plot(ma3, title="WMA", color=orange)
length4 = len2-len1
ma4 = ema(src, length4)
plot(ma4, title="EMA", color=yellow)
long = ma > ma and ma1 > ma1 and ma2 > ma2 and ma3 > ma3 and ma4 > ma4
short = ma < ma and ma1 < ma1 and ma2 < ma2 and ma3 < ma3 and ma4 < ma4
alertcondition(long == true, title='MACD LONG SIGNAL', message='MACD LONG!')
alertcondition(short == true, title='MACD SHORT SIGNAL', message='MACD SHORT!')
Combo Backtest 123 Reversal & Detrended Synthetic Price V 2 This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Detrended Synthetic Price is a function that is in phase with the
dominant cycle of real price data. This DSP is computed by subtracting
a half-cycle exponential moving average (EMA) from the quarter cycle
exponential moving average.
See "MESA and Trading Market Cycles" by John Ehlers pages 64 - 70.
WARNING:
- For purpose educate only
- This script to change bars colors.
EVWMA VWAP MACD Strategy [QuantNomad]Based on comment of @coondawg71 I tried to compare VWAP and EVWMA.
Both are sort of moving averages so I decided to create a MACD based on these 2 indicators.
In parameters you can set EVWMA Length and 2 smoothing lengths for "macd" and "signal".
Strategy seems to work pretty good at 2h-8h timeframes for crypto.
What do you thing about it?