Monthly Returns in Strategies with Market BenchmarkThis is a modified version of this excellent script Monthly Returns in PineScript Strategues by QuantNomad
I liked and used the script but wanted to see how strategy performed vs market on each month/year. So I am sharing back.
The modification consists in adding Market or Buy & Hold performance between parenthesis inside each cell to better see how strategy performed vs market.
Also, 3 red levels and 3 green levels have been used :
For green :
1/ Light when strategy pnl > 0 but < market
2/ medium when strategy pnl > 0 and > market
3/ Dark when strategy pnl > 0 and market < 0 or pnl > market x 2
Same logic in the opposite direction for red.
The strategy provided here is just a showcase of how to use the table in pine script.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
移动平均线
DC Breakout Strategy | This is simplicity at its finest.As the title already describes: this is a Donchian breakout strategy. This strategy, as of now, only goes long. It goes long when the price close makes a new high and the 8 day moving average is above the 32 day moving average. The strategy exits the trade if the price breaks the atr trailing stop of * 3 or the 8 day moving average crosses below the 32 day moving average.
This is simplicity at its finest.
Swing Multi Moving Averages Crypto and Stocks StrategySimple and efficient multi moving average strategy combined with risk management and time condition.
Indicators/ Tools used
Multi selection moving average type like SMA , EMA , SMMA , VWMA , VIDYA , FRAMA , T3 and much more
Limit 1 entry max per week, entry on monday exit on sunday or risk management tp/sl.
Rules for entry:
LONG:Close of the candle cross above the moving average while the previous close was below. All of this is happening during monday session.
SHORT:Close of the candle cross below the moving average while the previous close was above. All of this is happening during monday session.
Rules for exit:
We exit either on sunday or if we reach tp/sl levels.
Observations:
I recommend use the strategy 2 types, one for long and another for short, using different parameters since long and short movements behave differently.
For example for long we can use a shorter moving average longth and a higher tp/sl while for short we can use a bigger moving average length and a smaller tp/sl
If you have any questions let me know !
Swing VWAP Crypto and Stocks StrategyThis is a strategy designed for swing trading on markets such as crypto and stocks.
Its components are:
VWAP
Time Management
Risk management
Rules for entry:
We entry only on Monday, if our close of the candle crossed above VWAP
Rules for exit
We exit always on Sunday or if we either hit the TP/SL levels.
If you have any questions let me know
Adaptive Hull MA Trend tracerBINANCE:ETHUSDT
This is the first attempt to create a "PEFECT" trend tracer.
All the Moving Averages have a lag but I personally like the Hull Moving Average for the fast response and noise reduction.
However, due to the market behavior it is hard to choose the correct length of the Moving Average that will be suitable for current situation.
This Indicator uses the Bolinger Bands Width to adapt the length of the Hull Moving Average according to the following rule:
1) if the BBW (Bolinger Bands Width) is small => length of the MA is bigger in order to filter the noise of small price changes.
2) if the BBW is bigger => MA length is smaller to track the trend more accurately.
This script also has a strategy logic with RSI for a better entry and exit as well as the minimum allowed MA length.
Further work:
1) Full adaptation of the Moving average
2) Filter bad entries
Please let me know of any suggestions for improving this indicator.
Simple EMA20 Strategy + StochasticThis is a Trend Following Strategy.
The intent of this strategy is to catchthe price as it trends higher than the 20-period EMA and sell immediately after the price closes below it.
I have implemented calculations from Stochastic to make sure the price is coming from an oversold area.
There is also a check to see if the 20-period EMA is trending higher than before.
Low-High-Trend StrategyWhen asked what the key to successful investing was, Warren Buffet famously said “buy low, sell high.” Was he onto something? Today I am sharing with the community a simple “buy low, sell high” strategy with an optional trend filter and take-profit target. I’ve found that this strategy works well in a variety of markets but has a higher tendency to out-perform buy & hold in markets that are ranging sideways.
How it works:
The strategy tracks the highest and lowest price over the last X number of bars (you select the look-back period). The highest price line is plotted in green and the lowest price line is potted in red. If the price crosses over the lowest price in the last X number of bars, then a buy signal is generated. Exit options include a take-profit % or selling when the price crosses over the highest price in the last X amount of bars. I.e. “Buy low, sell high.” An EMA is also plotted as a blue trend line, and there is an option to only trade if the price is above the EMA trend line.
Disclaimer: Open source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. Even though this example script beats buy and hold over the back-test time-frame, I wouldn't advise using it as a stand-alone strategy without significant additions/modifications to the strategy and risk management functions. In this example the script is being used as a medium-term strategy with just 10% leverage over account equity, a $25k start balance, and back-testing 10+ years. Modifiable slippage and commissions are included in the model.
Green line = Highest price in the look-back period
Red line = Lowest price in the look-back period
Blue line = EMA Trend
RSI & SMA Strategy By DenizIntroduction
It has always been a major challenge to detect the current market price in technical analysis . There are some basic but strong indicators that help us to estimate the next market action. Relative Strength Index and Simple Moving Average indicators were used in this strategy.
This strategy aims to detect the next market action with different calculations & usages of RSI and SMA indicators.
Strategy Features
As per the result of the calculation from RSI and SMA outputs the strategy will decide to go "Long" or "Short" if the directions are changed from long to short the trade will be closed and it's opening new trade as per to the new direction.
Apart from basic "take profit" and "stop" options there is an additional closing trade option named "Long/Short Bar Count". If the trade could not reach the target in a certain period, it will look for a quit with a 0 loss.
Advantages
Informative alarm messages.
High ratio of Profitable trade numbers.
Disadvantages
Less trade count.
UT Bot v5This is an update by request, on someone elses strategy! well more of an edit, but also update from pine v4 to pine v5.
//CREDITS to HPotter for the orginal code. The guy trying to sell this as his own is a scammer lol.
//Edited and converted to @version=5 by SeaSide420 for Paperina
The UT Bot v5 is Movinging average (the MA) vs ATR (the ATR is in the form intended for use as trailing stop loss (ATR_TSL))
Entry logic:
buy = the MA > ATR_TSL and Price > ATR_TSL
sell = the MA < ATR_TSL and Price < ATR_TSL
The Moving average type can be changed in the settings:
options = "SMA", "EMA", "WMA", "HMA"]
the edits i made were:
convert to v5
Add TP and SL
Add Buy only or Sell only option
Add MA type option
Add price source option
Draw MA and ATR_TSL on-chart
RSI multitimeframe SMA crossoverStrategy based on the multi timeframe equally weighted RSI moving averages turned into single average and then cross of the 2 combined outputs, seems to be promising, default settings work good on 5m chart(better entry) but very filtered trade amount. If you want to use it on different timeframes be my guest and mess with adjustments, pretty much every aspect of strategy is adjustable, idea is same. If somebody liked the idea and able to improve it - share with me :)
(Short) EMA200+Parabolic SAR+MACD+TP&SL By Nussara (strategy)This indicator is backtest of “ (Short) EMA 200 + Parabolic SAR + MACD + Take Profit and Stop Loss”
You can simulate trading by setting your own funds and trading fees. And you can adjust various parameter settings to get the results you want.
Exponential Moving Average
Moving averages smooth the price data to form a trend following indicator. They do not predict price direction, but rather define the current direction, though they lag due to being based on past prices. Despite this, moving averages help smooth price action and filter out the noise.
EMA=Price(t)×k+EMA(y)×(1−k)
where:
t=today
y=yesterday
N=number of days in EMA
k=2÷(N+1)
Parabolic SAR
The Parabolic SAR is a technical indicator developed by J. Welles Wilder to determine the direction that an asset is moving. The indicator is also referred to as a stop and reverse system, which is abbreviated as SAR . It aims to identify potential reversals in the price movement of traded assets.
MACD
Moving average convergence divergence ( MACD ) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average ( EMA ) from the 12-period EMA . The result of that calculation is the MACD line. A nine-day EMA of the MACD called the "signal line," is then plotted on top of the MACD line, which can function as a trigger for buy and sell signals. Traders may buy the security when the MACD crosses above its signal line and sell—or short—the security when the MACD crosses below the signal line.
EMA 200 + Parabolic SAR + MACD (Short) formula
1. The price closes below the ema200 line.
2. MACD Line cross down Signal Line"
3. Parabolic SAR above the bar means that it is a downtrend.
If all three are true, the indicator will have a Short signal.
Risk to Reward Ratio = 1:1
Stop loss = Parabolic SAR point.
This indicator is just a tool for technical analysis . It shouldn't be used as the only indication of trade because it causes you to lose your money. You should use other indicators to analyze together.
Larry Williams 3 Period EMAs strategyLarry R. Williams explains this strategy in his book "Long-Term secrets to Short-Term trading", it consists of using two 3-period EMAs, one representing the Highs and the other the Lows.
When the price falls below the 3-period Lows EMA we have a long signal.
The trade is closed when the price closes above the 3-period Highs EMA . BINANCE:BTCUSDT
Dynamic Fib StrategyAfter publishing many complex scripts with a myriad of inputs that were confusing for the average user, and after being told my previous publications were overfitted and not easily applied across the board...I spent the past three months working on this masterpiece.
The script is very simple to use, and it MUST be used for timeframes of 10 minutes or more. Please do not use this strategy for lower timeframes thinking that more trades is a desireable trait in a strategy. Patience is a virtue, and it doesn't matter if there are 1000 bars between trades (I am exaggerating here) all crypto is cyclical in a short timeframe of days.
The script is based on moving averages, what is different about this script is that it is the result of months of analysis of the crosses that are key indicators of the best times to trade. It also identifies crosses that indicate when a massive dump is coming and when the dump turns back into a pump. It is designed to be a long strategy with the careful identification of the dump indicators so it preserves your capital and results in a better trade approach.
At the heart of this script is the Sutte MA and the SMA, and only a subset of the settings for these are exposed for user input to keep things simple.
The second key piece of how this script works is the Fibonnaci levels. For the purposes of using this script, the first two levels (Fib 1 and Fib 2) are only for display purposes of the bands and does not affect the triggers for trading. It is only the third and fourth levels which impact the trade triggerers for buying and selling. The idea here is that the best times to execute a trade is when the price moves into the outer bands as these are typical triggers for selloffs from those suffering from FOMO.
Since I have done quite a bit of work here, I do not wish for this script to be copied and pasted into other scripts. It is my coup de grace and there is not a script like this anywhere on TradingView that delves deep into the crosses that matter.
(Long) EMA 200 + Parabolic SAR + MACD By Nussara (strategy)This indicator is backtest of “ (Long) EMA 200 + Parabolic SAR + MACD + Take Profit and Stop Loss”
You can simulate trading by setting your own funds and trading fees. And you can adjust various parameter settings to get the results you want.
Exponential Moving Average
Moving averages smooth the price data to form a trend following indicator. They do not predict price direction, but rather define the current direction, though they lag due to being based on past prices. Despite this, moving averages help smooth price action and filter out the noise.
EMA=Price(t)×k+EMA(y)×(1−k)
where:
t=today
y=yesterday
N=number of days in EMA
k=2÷(N+1)
Parabolic SAR
The Parabolic SAR is a technical indicator developed by J. Welles Wilder to determine the direction that an asset is moving. The indicator is also referred to as a stop and reverse system, which is abbreviated as SAR. It aims to identify potential reversals in the price movement of traded assets.
MACD
Moving average convergence divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average (EMA) from the 12-period EMA. The result of that calculation is the MACD line. A nine-day EMA of the MACD called the "signal line," is then plotted on top of the MACD line, which can function as a trigger for buy and sell signals. Traders may buy the security when the MACD crosses above its signal line and sell—or short—the security when the MACD crosses below the signal line.
EMA 200 + Parabolic SAR + MACD (Long) formula
1. The price closes above the ema200 line.
2. MACD Line above Signal Line
3. Parabolic SAR below the bar means that it is an uptrend.
If all three are true, the indicator will have a buy signal.
Risk to Reward Ratio = 1:1
Stop loss = Parabolic SAR point.
This indicator is just a tool for technical analysis. It shouldn't be used as the only indication of trade because it causes you to lose your money. You should use other indicators to analyze together.
AleemTalks Crypto MachineOne of best Trend Trading Systems
It Included Moving Averages
Multi Time Frame Analysis
Order blocks
Support and Resistance
To understand it completely
You can Inbox me
Zero-Lag HMA Backtest v1.0 [loxx]This backtest compares profitability differences between a regular Hull Moving Average ( HMA ) and a Zero-Lag HMA .
Things to know:
- Profit is set to 1 ATR
- Stop-loss is set to 1.5 ATR.
- This is by design to test the minimum the profit scenario (1 ATR up) and the worst case loss scenario (1.5 ATR down) for momentum trading. Actual results vary when additional TPs are added
How to use:
- Adjust settings and dates to view different market structures and position scenarios
- See results in the "Strategy Tester" pane
Conclusions and what's next
- Modifying HMA does very little to improve backtest results
- Future iterations will include options to backtest various moving averages with additional modifiers to improve profits and avoide losses
Comment below or send a PM with questions, comments, observations, or concerns.
[001] Entry_Test [TradeStand]Entry_Exit_Test .
------------------------------------
Function description
------------------------------------
You can automatically receive an entry alert when the conditions you specify are met.
Settlement alerts can be sent automatically when the conditions you specify are met.
Three types of moving averages can be displayed.
------------------------------------
Entry and Settlement Conditions
------------------------------------
Trade Mode: Select the trade you wish to execute.
Date and time: Enter the date and time you wish to execute the trade.
Number of seconds: If you want to specify the number of seconds, please enter it.
Daily MA: The 5, 25, and 75 day moving averages are displayed.
------------------------------------
------------------------------------
Entry_Exit_Test .
------------------------------------
■機能説明
------------------------------------
あなたが指定した条件を満たした時に、エントリーアラートを自動的に配信することが出来ます。
あなたが指定した条件を満たした時に、決済アラートを自動的に配信することが出来ます。
3種類の移動平均線を表示することが出来ます。
------------------------------------
■エントリー・決済条件
------------------------------------
・トレードモード:実行したいトレードを選択します
・日時:実行したい日時を入力、または選択します
・秒数:秒数まで指定したい場合は入力してください
・日足MA:5、25、75日移動平均線が表示できます
[002] DAY_MA_Pass [TradeStand]Cond_for_Day_MA
------------------------------------
Function description
------------------------------------
You can automatically receive an entry alert when the conditions you specify are met.
Settlement alerts can be sent automatically when the conditions you specify are met.
Three types of moving averages can be displayed.
------------------------------------
Entry and Settlement Conditions
------------------------------------
Trade Mode: Select the trade you wish to execute.
Date and time: Enter the date and time you wish to execute the trade.
Number of seconds: If you want to specify the number of seconds, please enter it.
Daily MA: The 5, 25, and 75 day moving averages are displayed.
Daily MA Trade: Select for this function
Select MA: Select the moving average you want to use as a reference.
Select conditions: Select the current position relative to the moving average
------------------------------------
------------------------------------
Cond_for_Day_MA
日足移動平均線を基準としたエントリー・決済
------------------------------------
■機能説明
------------------------------------
あなたが指定した条件を満たした時に、エントリーアラートを自動的に配信することが出来ます。
あなたが指定した条件を満たした時に、決済アラートを自動的に配信することが出来ます。
3種類の移動平均線を表示することが出来ます。
------------------------------------
■エントリー・決済条件
------------------------------------
選択した時間に、移動平均線を「超えているか」「割っているか」で
エントリー・決済を実行できます。
・トレードモード:実行したいトレードを選択します
・日足MA表示:5、25、75日移動平均線が表示できます
・実行日時:実行したい日時を入力、または選択します
・秒数:秒数まで指定したい場合は入力してください
・日足MA基準トレード:この機能の「OFF/ON」を選択します
・指定 日足移動平均線:基準となる日足移動平均を選択します
・条件:移動平均線に対する現在の位置関係を選択します
Tendency EMA + RSI [Alorse]A very simple and highly effective strategy LONG & SHORT that combines only 2 indicators:
RSI
3 Moving Average Exponential (EMA)
LONG Entry conditions are:
EMA 20 cross over EMA 10
EMA 10 is above EMA 100
LONG Exit conditions are:
RSI greater than 70
Or when X number of candles have passed and the trade is in profit. (Check Settings)
SHORT Entry conditions are:
EMA 20 cross under EMA 10
EMA 10 is below EMA 100
SHORT Exit conditions are:
RSI is less than 30
Or when X number of candles have passed and the trade is in profit. (Check Settings)
Indicators & Conditions Test Framework [DTU]Hello All,
This script is a framework to build strategies by combining indicators and conditions (long, short, exits). You are able to analyze your strategies in realtime by changing the input parameters related to indicators, conditions and their combinations.
OVERVIEW
With this Study/Strategy framework, you will be able to create strategy conditions, display them on the chart, and test them using existing indicators as well as external and custom indicators that you can add.
The main purpose of the Framework is to choose your indicators to be used in the conditions and test your strategy by producing your "Long, short, Exit long, Exit short" combinations.
Although may be, it can be a bit difficult and complicated at first start, but you can understand the logic on its use in a very short time.
Notes:
I removed external links off descriptive images and video to be comply with Trading view violation House Rules
Since I am new in the community and still trying to understand the pine script language I can make errors and violations on my script. Please Inform me on any issue that I made..
HOW TO
STEP 1: SETTINGS ______________________________________________________________________________________________________
SOURCE, TIMEFRAME, SECURITY
Select the Source, timeframe and Secure type that your indicators will use.
Here, the Secure entry consists of 3 parts and the f_security function is used to determine it.
a)Secure
This option is defined as reducing repaint in tradingview calculations as much as possible. The following function is used.
request.security(_symbol, _res, _src , lookahead=barmerge.lookahead_on)
b)Semi Secure
While this option can reduce repaint in tradingview calculations as much as possible, it is less secure. The following function is used.
request.security(_symbol, _res, _src )
c)Repaint
This option turns on the repaint feature. The following function is used.
request.security(_symbol, _res, _src ) : na
Ind Source:
You can the source that indicators will use their own calculations
Ext Source:
You can import external Indicator sources from here . It appears on condition/combination area as "EXT".
To export the External indicator plot it with a title. It will be visible in source dropdown input
PERIOD , ALERTS...
Period:
Determine your strategy testing period by selecting start and end date/time
(!!! According to your tradingview subscription, it takes the last 5000, 10000.. bars.
The extra bar option may cause problems such as not appearing in the calculations or errors).
Plot Alerts:
Plot condition result as alerts arrows on the chart's bottom for "LONG" and the top for "SHORT" entries, exits
Close on opposite:
When selected, a long entry gets closed when a short entry opens and vice versa
Show Profit:
It appears if script is in strategy mode (not in study) this can display current or open profit for better reanalyzing your strategy entry exit points. (Currently under development)
PLOT TYPE OPERATIONS
This option has 4 entries
a) Mult
Sets the multiplier for the selected Plot Type (stochastic, Percentrank, Org Range (-1,1) ) except for "Original" in the range (-1,1).
EXAMPLE: When 1000 is selected, the indicator in the range of (-1,1) will appear in the range of (-1000, 1000) on the screen.
b) Shift
It determines the shift that will appear on the screen for the selected Plot Type (stochastic, Percentrank,Org Range (-1,1) ) in the range (-1,1) other than "Original".
EXAMPLE: When Shift:35000 and mult:1000 are selected, the indicator will appear in the range (34000, 36000) on the screen.
c) Smooth
This option (only for Stochastic & PercentRank) allows to smooth the indicator to be displayed.
Here, tradinview ta.swma function is used.
b) hline
Adjusts the horizontal lines to appear on the screen according to the mult factor for the range (-1,1)
The lines represent the values (-1, -05, 0, 05, 1)
STEP 2: INDICATORS ______________________________________________________________________________________________________
You need to choose indicators that you can use in strategy conditions.
Here, the indicators come from the dturkuler/lib_Indicators_DT open script library defined in the code
In addition, you can add the indicators that you will create in the area defined in the code to this list..
You can also import external indicators and test them with other variables on the system..
You can choose a maximum of 5 indicators that you can use in total. (can be increased in new versions)
Indicators are categorized in 3 main sections
Indicator Selection:
You can select your indicators from this area
a)Moving Averages
These are indicators such as EMA, SMA that you can show on the stock. They come from the library.
These indicators are fed from Settings/source. Only the length value can be used as a parameter.
In addition, line colors can be changed..
As of now, there are 28 indicators in the library in total and 5 indicators are left as future use for this field for now.
b)Other Indicators
These are different indicators from the stock value such as RSI, COG. They come from the library. These indicators are fed from Settings/source.
Only the length value can be used as a parameter. In addition, line colors can be changed.
As of now, there are 24 indicators in the library in total and 5 indicators are left as a future use for this field for now.
c)Custom Indicators
These indicators are the ones you can create by programming yourself in the source code..
The area at the bottom of the settings screen is reserved for the parameters of this type of indicators.
Indicator Length:
You can update your selected indicator length value from here. (Not: it doesn't work for custom indicators since they have their parameter on cust. Ind. input screen )
Indicator Plot Type:
Next to the indicators, there is an input selection field about how they will be displayed on the screen.
a)Original
The indicator is displayed on the screen with its current values. It is an ideal solution for displaying moving average indicators such as (EMA, SMA) over current stock.
Since the values of indicators such as (RSI, COB) are low (-100,100 : -1.1), they appear at the bottom of the screen and make analysis difficult.
For this reason, other options may be more suitable for these.
b)Stochastic
The indicator is displayed on the screen with stochastic calculation in the range of -1.1.
It uses the stochastic(50) calculation method to spread indicators such as (RSI, COB) over the range (-1,1).
Indicators in this selection can be fixed and monitored under stock on the screen with the parameters under the Plot Type section.
You can see the original values of the relevant indicator on the Data Window screen.
(!!! Do not use the values on the chart in your condition calculations. Instead, get the values from Data Window)
c)PercentRank
The indicator is displayed on the screen with stochastic calculation in the range of -1.1. .
Since the values of indicators such as (RSI, COB) are low (-100,100 : -1.1), they appear at the bottom of the screen and make analysis difficult.
Indicators in this selection can be fixed and monitored under stock on the screen with the parameters under the Plot Type section.
You can see the original values of the relevant indicator on the Data Window screen
((!!! Do not use the values on the chart in your condition calculations. Instead, get the values from Data Window)
d)Org Range (-1,1)
If your indicator is in the range of -1.1, your indicator will be displayed on the screen with its original calculation in the range of -1.1.
Indicators in this selection can be fixed and monitored under stock on the screen with the parameters under the Plot Type section.
You can see the original values of the relevant indicator on the Data Window screen.
(!!! Do not use the values on the chart in your fitness calculations. Instead, get the values from Data Window)
STEP 2 NOTES:
STEP 3: CONDITIONS ______________________________________________________________________________________________________
After choosing the indicators you will use in the conditions, you move on to the "CONDITIONS" section.
There are 4 conditions type here.
• LONG ENTRY CONDITION
• SHORT ENTRY CONDITION
• LONG CLOSE CONDITION
• SHORT CLOSE CONDITION
The use of each condition is the same.
There are 3 combinations you can use in each condition. (can be increased in new versions)
a)COMBINATIONS
There are 3 combinations you can use in each condition. (can be increased in new versions)
Each combination are build from 4 parts
1)1st Indicator
If set to "NONE" this combination will not be used on calculations. You can select
IND1-5: from indicators (See above),
EXT: value from externally imported indicator
Stock built-in values: close, open...
2)Operator
Selected Operator compares 1st Indicator with the 2nd one. You can select different operators such as
crossover, crossunder, cross,>,<,=....
3)2nd Indicator
This indicator will be compared with the 1st one via selected Operator. You can select
IND1-5: from indicators (See above),
VALUE: a float value defined in the combinations value parameter
EXT: value from externally imported indicator
Stock builtin values: close,open...
4)Value
When the 2nd indicator field is "VALUE", value area compares the entered value.
ex: 1st indicator="open", op=">", 2nd indicator="VALUE", value=3000.12 means is(close>3000.12)
In other conditions, it compares the previous values of the indicator.
ex: 1st indicator="open", op=">" 2nd indicator is "close" and value is 2 means is(open>close )
EXAMPLES:
indicator 1= "IND1", Operator=">", indicator 2= "IND2" => is(IND1>IND2)
indicator 1= "IND1", Operator=">", indicator 2= "VALUE", "0.1" => is(IND1>0.9)
indicator 1= "IND2", Operator="crossover", indicator 2= "IND1" => is(IND2 crossover IND1) : like a=ta.crossover(IND2, IND1)
indicator 1= "IND1", Operator="<", indicator 2= "close" => is(IND1>close)
indicator 1= "IND1", Operator="<", indicator 2= "EXT" => is(IND1>EXT) , EXT mean external imported indicator that define on settings section
indicator 1= "IND1", Operator="<", indicator 2= "IND1", Value="1" => is (IND1>IND1 )
b)JOIN COMBINATIONS
Each combination in Condition is compared with the next one via JOIN operator
The join operator can be selected as AND or OR.
Examples:
1st combination= is(IND1>0.9) true
2nd combination= is(IND2 crossover IND1) false
1st combination "AND" 2ndcombination" => false (is(IND1>0.9) AND is(IND2 crossover IND1))
1st combination "OR" 2nd combination" => true (is(IND1>0.9) OR is(IND2 crossover IND1))
STEP 3 NOTES:
When the 2nd indicator field is "VALUE", value area compares the entered value. In other conditions, it compares the previous values of the indicator.
In cases where "VALUE" is not selected, integer values must be entered in this field. (float should not be entered. ie 1, 2 should be entered)
!!!If the 1st indicator is "NONE" in the combination, that combination is cancelled.
Each combination returns true/false, allowing the selected value to be compared with another value
Example: EMA(21)>EMA(50) returns true under all conditions or (EMA(21) crossover EMA(50)) returns true when passed.
You can use , Value of 5 indicators (IND1-IND5) or (VALUE) that you have defined in combinations or import indicator (EXT) or stock values (close, open, high...) in your calculations.
combination Compares the 1st indicator with 2nd indicator via the operator.
STEP 4: CUSTOM INDICATORS ______________________________________________________________________________________________________
There is an area in the code for designing Custom Indicators.
Here you can design your own indicators and use them in the framework.
You can also create unlimited parameters for your indicators in the SETTINGS custom indicator field.
For now, only 3 Custom indicators have been defined.
Examples are entered in the code for custom indicators.
STEP 4 NOTES:
Including / updating custom to the code is explained in the source code
• LIMITATIONS:
!!! According to your tradingview subscription, it takes the last 5000, 10000.. bars. More bar options may cause problems such as not appearing in the calculations or errors.
• RAMBLINGS:
• NOTES [ /i]
This Script can be used as an indicator if the last strategy parts in the code are commented out and converted to the initial strategy study.
It was originally prepared for my use with my own strategy framework and has export functions accordingly.
When integrated to my own strategy framework it brings many more features over strategy definition of trades.
• TODO [ /i]
TODO: Add tooltips to the settings screen
TODO: Add double triple, Quatr factor for all indicators (convert any indicator to factor2-4 facotr. ex: EMA to DEMA, TEMA, QEMA...)
TODO: Add factorized Fibo avg range indicator (good for trend definition and entry exit points)
TODO: Add bands to the indicator and conditions
TODO: Add debug window for exporting indicator's parameters
TODO: Add isRising(value) isFalling(value), is...(value) .... to combinations (they can be used as custom indicator also
TODO: Reassess condition entry screen for user friendly GUI
TODO: Increase # conditions from 3 to 4
TODO: Reassess strategy entries, exit and close (should be improved)
TODO: Add Alerts, Condiional alerts for indicator (study) part
TODO: Create export function v3 for Pinecoders Indicator framework
• THANKS:
For Pine script format docs RicardoSantos .
For Pine script coding standards Pinecoders .
For moving average script used on library s RodrigoKazuma .
EMA RSI ADX Scalping StrategyThis is the strategy version of my ERA Indicator. You can check my scripts if you'd like to use only study indicator.
Strategy Rules For Long Entry:
- Check if price above the set EMA (Can disable this rule if you'd like in the settings)
- RSI is in Oversold
- ADX is above set "Trend Ready" threshold (Meaning there is a trend going on)
- Price must approve the trend of previous candles. This is bullish for buy entries and bearish for sell entries.
- Enter with stop loss below last swing low with 1:1 or 1.5:1 take profit ratio.
Strategy Rules For Short Entry:
- Check if price below the set EMA (Can disable this rule if you'd like in the settings)
- RSI is in Overbought
- ADX is above set "Trend Ready" threshold (Meaning there is a trend going on)
- Price must approve the trend of previous candles. This is bullish for buy entries and bearish for sell entries.
- Enter with stop loss above last swing high with 1:1 or 1.5:1 take profit ratio. (Can be adjusted)
Features:
- You can modify a lot values to your liking.
- Choose Fixed or Trailing Stop Loss / Take Profit with detailed modifiers.
- You can connect it to bots if you'd like.
- It does NOT repaint.
- Since it's a scalping strategy recommended to use on 15 min or below timelines.
- Choose if you want to stop entry on opposite signals.
- And some other things i may not remember right now...
I tried to code this as modifiable as possible. Let me know if there are any problems you encounter. Open to suggestions as well.
Happy Trading.