Initial Commit ...
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# Trend Magic Scalping (TMPLMCD5M)
|
||||
|
||||
## Setup
|
||||
|
||||
- **TF**: 5m
|
||||
- **Asset**: TSLA
|
||||
- **R2R**: 1:2
|
||||
- **Indicators**:
|
||||
- Trend Magic (KivancQzbilgic):
|
||||
- Change Plot Blue color to Green;
|
||||
- Change CCI Period to 18;
|
||||
- **Oscillators**:
|
||||
- Impulse MACD by LazyBear:
|
||||
- Change ImpulseMACD shows as Columns;
|
||||
- Change ImpulseMACD Color 3 to Red;
|
||||
- Change Color of ImpulsHisto to Yellow;
|
||||
|
||||
## Using the Strategy
|
||||
|
||||
### Long/Buy Conditions
|
||||
|
||||
- ImpulseMACD gives Green DownSide (Reversal);
|
||||
- ImpulseMACD Green Column is above of ImpulseMACD signal line;
|
||||
- ImpulseHisto Yellow is above MACD green Bar (above zero line);
|
||||
- TrendMagic is Green;
|
||||
- Market froms a Bullish Candle;
|
||||
|
||||
#### Long SL
|
||||
|
||||
place sl at prev MArket lowest
|
||||
|
||||
#### Long TP
|
||||
|
||||
calculate based on R2R;
|
||||
|
||||
### Short/Sell Conditions
|
||||
|
||||
- ImpulseMACD gives Red UpSide (Reversal);
|
||||
- ImpulseMACD Red Column is below of ImpulseMACD signal line;
|
||||
- ImpulseHisto Yellow is below MACD Red Bar (below zero line);
|
||||
- TrendMagic is Red;
|
||||
- Market froms a Berish Candle;
|
||||
|
||||
#### Short SL
|
||||
|
||||
place sl at prev market highest;
|
||||
|
||||
#### Short TP
|
||||
|
||||
calculate based on R2R;
|
||||
|
||||
### Signals Overlap
|
||||
|
||||
how to handle signals overlaps.
|
||||
@@ -0,0 +1,96 @@
|
||||
# XST_TMPLMCD5M
|
||||
|
||||
## Report
|
||||
|
||||
### Makret
|
||||
|
||||
BTCUSDT.P
|
||||
|
||||
### Exchange
|
||||
|
||||
OKX
|
||||
|
||||
### Time Frame
|
||||
|
||||
5min
|
||||
|
||||
### Start Date
|
||||
|
||||
19 may 2023 | 03:20 UTC
|
||||
|
||||
### End Date
|
||||
|
||||
22 may 2023 | 15:10 UTC
|
||||
|
||||
### Risk to Reward
|
||||
|
||||
1:2
|
||||
|
||||
### Reports
|
||||
|
||||
#### Longs
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Long | | x | |
|
||||
| 2 | Long | | x | |
|
||||
| 3 | Long | | x | |
|
||||
| 4 | Long | x | | |
|
||||
| 5 | Long | x | | |
|
||||
| 6 | Long | x | | |
|
||||
| 7 | Long | | x | |
|
||||
| 8 | Long | x | | |
|
||||
| 9 | Long | | | |
|
||||
| 10 | Long | | | |
|
||||
| 11 | Long | | | |
|
||||
| 12 | Long | | | |
|
||||
| 13 | Long | | | |
|
||||
| 14 | Long | | | |
|
||||
| 15 | Long | | | |
|
||||
| 16 | Long | | | |
|
||||
| 17 | Long | | | |
|
||||
| 18 | Long | | | |
|
||||
| 19 | Long | | | |
|
||||
| 20 | Long | | | |
|
||||
|
||||
#### Shorts
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Short | | | Open |
|
||||
| 2 | Short | x | | |
|
||||
| 3 | Short | x | | |
|
||||
| 4 | Short | | x | |
|
||||
| 5 | Short | | x | |
|
||||
| 6 | Short | | x | |
|
||||
| 7 | Short | | x | |
|
||||
| 8 | Short | x | | |
|
||||
| 9 | Short | x | | |
|
||||
| 10 | Short | | x | |
|
||||
| 11 | Short | x | | |
|
||||
| 12 | Short | | x | |
|
||||
| 13 | Short | | | |
|
||||
| 14 | Short | | | |
|
||||
| 15 | Short | | | |
|
||||
| 16 | Short | | | |
|
||||
| 17 | Short | | | |
|
||||
| 18 | Short | | | |
|
||||
| 19 | Short | | | |
|
||||
| 20 | Short | | | |
|
||||
|
||||
#### Signals Results
|
||||
|
||||
| Type | Count | TPs | SLs |
|
||||
| :----: | :-: | :-: | :-: |
|
||||
| Longs | 08 | 04 | 04 |
|
||||
| Shorts | 12 | 05 | 06 | 1 OPEN
|
||||
| Total | 00 | 00 | 00 |
|
||||
|
||||
#### Analysis
|
||||
|
||||
per trade volume: 10$
|
||||
total drawdown: 200$
|
||||
total lose: 100$
|
||||
total reward: 180$
|
||||
total cash: 100$ + 180$ = 280$
|
||||
win rate: 40%
|
||||
@@ -0,0 +1,96 @@
|
||||
# XST_TMPLMCD5M
|
||||
|
||||
## Report
|
||||
|
||||
### Makret
|
||||
|
||||
ETHUSDT
|
||||
|
||||
### Exchange
|
||||
|
||||
Kucoin
|
||||
|
||||
### Time Frame
|
||||
|
||||
5min
|
||||
|
||||
### Start Date
|
||||
|
||||
14 may 2023 | 07:25 UTC
|
||||
|
||||
### End Date
|
||||
|
||||
22 may 2023 | 08:55 UTC
|
||||
|
||||
### Risk to Reward
|
||||
|
||||
1:2
|
||||
|
||||
### Reports
|
||||
|
||||
#### Longs
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Long | x | | |
|
||||
| 2 | Long | | x | |
|
||||
| 3 | Long | x | | |
|
||||
| 4 | Long | | x | |
|
||||
| 5 | Long | | x | |
|
||||
| 6 | Long | | x | |
|
||||
| 7 | Long | | x | |
|
||||
| 8 | Long | x | | |
|
||||
| 9 | Long | | | |
|
||||
| 10 | Long | | | |
|
||||
| 11 | Long | | | |
|
||||
| 12 | Long | | | |
|
||||
| 13 | Long | | | |
|
||||
| 14 | Long | | | |
|
||||
| 15 | Long | | | |
|
||||
| 16 | Long | | | |
|
||||
| 17 | Long | | | |
|
||||
| 18 | Long | | | |
|
||||
| 19 | Long | | | |
|
||||
| 20 | Long | | | |
|
||||
|
||||
#### Shorts
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Short | | x | |
|
||||
| 2 | Short | x | | |
|
||||
| 3 | Short | x | | |
|
||||
| 4 | Short | | x | |
|
||||
| 5 | Short | x | | |
|
||||
| 6 | Short | | x | |
|
||||
| 7 | Short | x | | |
|
||||
| 8 | Short | x | | |
|
||||
| 9 | Short | x | | |
|
||||
| 10 | Short | x | | |
|
||||
| 11 | Short | | x | |
|
||||
| 12 | Short | x | | |
|
||||
| 13 | Short | | | |
|
||||
| 14 | Short | | | |
|
||||
| 15 | Short | | | |
|
||||
| 16 | Short | | | |
|
||||
| 17 | Short | | | |
|
||||
| 18 | Short | | | |
|
||||
| 19 | Short | | | |
|
||||
| 20 | Short | | | |
|
||||
|
||||
#### Signals Results
|
||||
|
||||
| Type | Count | TPs | SLs |
|
||||
| :----: | :-: | :-: | :-: |
|
||||
| Longs | 08 | 03 | 05 |
|
||||
| Shorts | 12 | 08 | 04 |
|
||||
| Total | 20 | 11 | 09 |
|
||||
|
||||
#### Analysis
|
||||
|
||||
per trade volume: 10$
|
||||
total drawdown: 200$
|
||||
total lose: 90$
|
||||
total reward: 220$
|
||||
total cash: 110$ + 220$ = 330$
|
||||
win rate: 65%
|
||||
@@ -0,0 +1,100 @@
|
||||
# XST_TMPLMCD5M
|
||||
|
||||
## Report
|
||||
|
||||
### Makret
|
||||
|
||||
Micro Strategy
|
||||
|
||||
### Exchange
|
||||
|
||||
NASDAQ
|
||||
|
||||
### Time Frame
|
||||
|
||||
5min
|
||||
|
||||
### Start Date
|
||||
|
||||
14 Feb 2023 | 14:30 UTC
|
||||
|
||||
### End Date
|
||||
|
||||
18 may 2023 | 18:45 UTC
|
||||
|
||||
### Risk to Reward
|
||||
|
||||
1:2
|
||||
|
||||
### Reports
|
||||
|
||||
#### Longs
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Long | x | | |
|
||||
| 2 | Long | x | | |
|
||||
| 3 | Long | x | | |
|
||||
| 4 | Long | x | | |
|
||||
| 5 | Long | | x | |
|
||||
| 6 | Long | x | | |
|
||||
| 7 | Long | | x | |
|
||||
| 8 | Long | | x | |
|
||||
| 9 | Long | | x | |
|
||||
| 10 | Long | | x | |
|
||||
| 11 | Long | x | | |
|
||||
| 12 | Long | x | | |
|
||||
| 13 | Long | | x | |
|
||||
| 14 | Long | | x | |
|
||||
| 15 | Long | x | | |
|
||||
| 16 | Long | x | | |
|
||||
| 17 | Long | | x | |
|
||||
| 18 | Long | | x | |
|
||||
| 19 | Long | | x | |
|
||||
| 20 | Long | | x | |
|
||||
| 21 | Long | | x | |
|
||||
| 22 | Long | | x | |
|
||||
|
||||
#### Shorts
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Short | x | | |
|
||||
| 2 | Short | | x | |
|
||||
| 3 | Short | | x | |
|
||||
| 4 | Short | | x | |
|
||||
| 5 | Short | | x | |
|
||||
| 6 | Short | x | | |
|
||||
| 7 | Short | | x | |
|
||||
| 8 | Short | | x | |
|
||||
| 9 | Short | | x | |
|
||||
| 10 | Short | x | | |
|
||||
| 11 | Short | | x | |
|
||||
| 12 | Short | | x | |
|
||||
| 13 | Short | | x | |
|
||||
| 14 | Short | | x | |
|
||||
| 15 | Short | | x | |
|
||||
| 16 | Short | | x | |
|
||||
| 17 | Short | x | | |
|
||||
| 18 | Short | x | | |
|
||||
| 19 | Short | x | | |
|
||||
| 20 | Short | | x | |
|
||||
| 21 | Short | | x | |
|
||||
| 22 | Short | x | | |
|
||||
|
||||
#### Signals Results
|
||||
|
||||
| Type | Count | TPs | SLs |
|
||||
| :----: | :-: | :-: | :-: |
|
||||
| Longs | 22 | 09 | 13 |
|
||||
| Shorts | 22 | 07 | 15 |
|
||||
| Total | 44 | 16 | 28 |
|
||||
|
||||
#### Analysis
|
||||
|
||||
per trade volume: 10$
|
||||
total drawdown: 440$
|
||||
total lose: 280$
|
||||
total reward: 320$
|
||||
total cash: 480$
|
||||
win rate: 9.09%
|
||||
@@ -0,0 +1,96 @@
|
||||
# XST_TMPLMCD5M
|
||||
|
||||
## Report
|
||||
|
||||
### Makret
|
||||
|
||||
TSLA
|
||||
|
||||
### Exchange
|
||||
|
||||
NASDAQ
|
||||
|
||||
### Time Frame
|
||||
|
||||
5min
|
||||
|
||||
### Start Date
|
||||
|
||||
10 mar 2023 | 15:05 UTC
|
||||
|
||||
### End Date
|
||||
|
||||
16 may 2023 | 14:25 UTC
|
||||
|
||||
### Risk to Reward
|
||||
|
||||
1:2
|
||||
|
||||
### Reports
|
||||
|
||||
#### Longs
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Long | x | | |
|
||||
| 2 | Long | x | | |
|
||||
| 3 | Long | | x | |
|
||||
| 4 | Long | | x | |
|
||||
| 5 | Long | | | |
|
||||
| 6 | Long | | | |
|
||||
| 7 | Long | | | |
|
||||
| 8 | Long | | | |
|
||||
| 9 | Long | | | |
|
||||
| 10 | Long | | | |
|
||||
| 11 | Long | | | |
|
||||
| 12 | Long | | | |
|
||||
| 13 | Long | | | |
|
||||
| 14 | Long | | | |
|
||||
| 15 | Long | | | |
|
||||
| 16 | Long | | | |
|
||||
| 17 | Long | | | |
|
||||
| 18 | Long | | | |
|
||||
| 19 | Long | | | |
|
||||
| 20 | Long | | | |
|
||||
|
||||
#### Shorts
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Short | x | | |
|
||||
| 2 | Short | | x | |
|
||||
| 3 | Short | x | | |
|
||||
| 4 | Short | x | | |
|
||||
| 5 | Short | | x | |
|
||||
| 6 | Short | | x | |
|
||||
| 7 | Short | | | |
|
||||
| 8 | Short | | | |
|
||||
| 9 | Short | | | |
|
||||
| 10 | Short | | | |
|
||||
| 11 | Short | | | |
|
||||
| 12 | Short | | | |
|
||||
| 13 | Short | | | |
|
||||
| 14 | Short | | | |
|
||||
| 15 | Short | | | |
|
||||
| 16 | Short | | | |
|
||||
| 17 | Short | | | |
|
||||
| 18 | Short | | | |
|
||||
| 19 | Short | | | |
|
||||
| 20 | Short | | | |
|
||||
|
||||
#### Signals Results
|
||||
|
||||
| Type | Count | TPs | SLs |
|
||||
| :----: | :-: | :-: | :-: |
|
||||
| Longs | 04 | 02 | 02 |
|
||||
| Shorts | 06 | 03 | 03 |
|
||||
| Total | 10 | 05 | 05 |
|
||||
|
||||
#### Analysis
|
||||
|
||||
per trade volume: 10$
|
||||
total drawdown: 100$
|
||||
total lose: 50$
|
||||
total reward: 100$
|
||||
total cash: 150$
|
||||
win rate: 50%
|
||||
@@ -0,0 +1,96 @@
|
||||
# XST_TMPLMCD5M
|
||||
|
||||
## Report
|
||||
|
||||
### Makret
|
||||
|
||||
XAUUSD
|
||||
|
||||
### Exchange
|
||||
|
||||
Forex.com
|
||||
|
||||
### Time Frame
|
||||
|
||||
5min
|
||||
|
||||
### Start Date
|
||||
|
||||
1 may 2023 | 13:45 UTC
|
||||
|
||||
### End Date
|
||||
|
||||
22 may 2023 | 06:30 UTC
|
||||
|
||||
### Risk to Reward
|
||||
|
||||
1:2
|
||||
|
||||
### Reports
|
||||
|
||||
#### Longs
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Long | | x | |
|
||||
| 2 | Long | x | | |
|
||||
| 3 | Long | | x | |
|
||||
| 4 | Long | | x | |
|
||||
| 5 | Long | | x | |
|
||||
| 6 | Long | x | | |
|
||||
| 7 | Long | | x | |
|
||||
| 8 | Long | x | | |
|
||||
| 9 | Long | | x | |
|
||||
| 10 | Long | x | | |
|
||||
| 11 | Long | | x | |
|
||||
| 12 | Long | | | |
|
||||
| 13 | Long | | | |
|
||||
| 14 | Long | | | |
|
||||
| 15 | Long | | | |
|
||||
| 16 | Long | | | |
|
||||
| 17 | Long | | | |
|
||||
| 18 | Long | | | |
|
||||
| 19 | Long | | | |
|
||||
| 20 | Long | | | |
|
||||
|
||||
#### Shorts
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Short | x | | |
|
||||
| 2 | Short | | x | |
|
||||
| 3 | Short | x | | |
|
||||
| 4 | Short | x | | |
|
||||
| 5 | Short | | x | |
|
||||
| 6 | Short | x | | |
|
||||
| 7 | Short | x | | |
|
||||
| 8 | Short | | x | |
|
||||
| 9 | Short | x | | |
|
||||
| 10 | Short | | | |
|
||||
| 11 | Short | | | |
|
||||
| 12 | Short | | | |
|
||||
| 13 | Short | | | |
|
||||
| 14 | Short | | | |
|
||||
| 15 | Short | | | |
|
||||
| 16 | Short | | | |
|
||||
| 17 | Short | | | |
|
||||
| 18 | Short | | | |
|
||||
| 19 | Short | | | |
|
||||
| 20 | Short | | | |
|
||||
|
||||
#### Signals Results
|
||||
|
||||
| Type | Count | TPs | SLs |
|
||||
| :----: | :-: | :-: | :-: |
|
||||
| Longs | 11 | 04 | 07 |
|
||||
| Shorts | 09 | 06 | 03 |
|
||||
| Total | 20 | 10 | 10 |
|
||||
|
||||
#### Analysis
|
||||
|
||||
per trade volume: 10$
|
||||
total drawdown: 200$
|
||||
total lose: 100$
|
||||
total reward: 200$
|
||||
total cash: 300$
|
||||
win rate: 50%
|
||||
@@ -0,0 +1,96 @@
|
||||
# XST_TMPLMCD5M
|
||||
|
||||
## Report
|
||||
|
||||
### Makret
|
||||
|
||||
XMRUSDT.P
|
||||
|
||||
### Exchange
|
||||
|
||||
Binance
|
||||
|
||||
### Time Frame
|
||||
|
||||
1h
|
||||
|
||||
### Start Date
|
||||
|
||||
8 jan 2023 | 14:00 UTC
|
||||
|
||||
### End Date
|
||||
|
||||
9 may 2023 | 03:00 UTC
|
||||
|
||||
### Risk to Reward
|
||||
|
||||
1:2
|
||||
|
||||
### Reports
|
||||
|
||||
#### Longs
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Long | | x | |
|
||||
| 2 | Long | x | | |
|
||||
| 3 | Long | x | | |
|
||||
| 4 | Long | | x | |
|
||||
| 5 | Long | | x | |
|
||||
| 6 | Long | x | | |
|
||||
| 7 | Long | | x | |
|
||||
| 8 | Long | | x | |
|
||||
| 9 | Long | | x | |
|
||||
| 10 | Long | | | |
|
||||
| 11 | Long | | | |
|
||||
| 12 | Long | | | |
|
||||
| 13 | Long | | | |
|
||||
| 14 | Long | | | |
|
||||
| 15 | Long | | | |
|
||||
| 16 | Long | | | |
|
||||
| 17 | Long | | | |
|
||||
| 18 | Long | | | |
|
||||
| 19 | Long | | | |
|
||||
| 20 | Long | | | |
|
||||
|
||||
#### Shorts
|
||||
|
||||
| ID | Position Type | TP | SL | Description |
|
||||
| :--: | :-----------: | :--: | :--: | :---------- |
|
||||
| 1 | Short | x | | |
|
||||
| 2 | Short | | x | |
|
||||
| 3 | Short | | x | |
|
||||
| 4 | Short | x | | |
|
||||
| 5 | Short | | x | |
|
||||
| 6 | Short | x | | |
|
||||
| 7 | Short | | x | |
|
||||
| 8 | Short | x | | |
|
||||
| 9 | Short | | x | |
|
||||
| 10 | Short | | x | |
|
||||
| 11 | Short | | x | |
|
||||
| 12 | Short | | | |
|
||||
| 13 | Short | | | |
|
||||
| 14 | Short | | | |
|
||||
| 15 | Short | | | |
|
||||
| 16 | Short | | | |
|
||||
| 17 | Short | | | |
|
||||
| 18 | Short | | | |
|
||||
| 19 | Short | | | |
|
||||
| 20 | Short | | | |
|
||||
|
||||
#### Signals Results
|
||||
|
||||
| Type | Count | TPs | SLs |
|
||||
| :----: | :-: | :-: | :-: |
|
||||
| Longs | 09 | 03 | 06 |
|
||||
| Shorts | 11 | 04 | 07 |
|
||||
| Total | 20 | 07 | 13 |
|
||||
|
||||
#### Analysis
|
||||
|
||||
per trade volume: 10$
|
||||
total drawdown: 200$
|
||||
total lose: $
|
||||
total reward: $
|
||||
total cash: $
|
||||
win rate: %
|
||||
@@ -0,0 +1,344 @@
|
||||
///////////////////////////////////////////////////////
|
||||
//
|
||||
// SaherElm IT Center XTrade TMPLMCD5M Strategy
|
||||
// ---------------------------------------------
|
||||
// in this strategy i must use:
|
||||
// - Price Action Candle Recognition Indicator;
|
||||
// - Swing Stop Loss Indicator;
|
||||
// - TrenMagic Indicator;
|
||||
// - Impulse MACD Oscillator;
|
||||
// - Cycle Channel Oscillator;
|
||||
//
|
||||
// Maintainer:
|
||||
// ------------
|
||||
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
||||
//
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
//@version=5
|
||||
indicator(title="SaherElm XTrade TMPLMCD5M Strategy", shorttitle = "XST_TMPLMCD5M", overlay = true)
|
||||
|
||||
//
|
||||
// START Inputs ....
|
||||
//
|
||||
//
|
||||
// Determines Show Signals or not ...
|
||||
showSignals = input.bool(defval = true, title = "Show Signals", group = "Strategy")
|
||||
showStopLosses = input.bool(defval = true, title = "Show Stop Losses", group = "Strategy")
|
||||
|
||||
//
|
||||
// Show Signals based on their types ...
|
||||
showLongSignals = input.bool(defval = true, title = "Show Long Signals", group = "Signals")
|
||||
showShortSignals = input.bool(defval = true, title = "Show Short Signals", group = "Signals")
|
||||
|
||||
//
|
||||
// Show Stop Losses based on their types ...
|
||||
swingLoopback = input.int(defval = 7, title = "Swing Loopback Period", group = "Stop Loss")
|
||||
showLongStopLosses = input.bool(defval = true, title = "Show Long Stop Losses", group = "Stop Loss")
|
||||
showShortStopLosses = input.bool(defval = true, title = "Show Short Stop Losses", group = "Stop Loss")
|
||||
//
|
||||
// END Inputs ....
|
||||
//
|
||||
|
||||
//
|
||||
// START Functions ....
|
||||
//
|
||||
//////////////////////////////
|
||||
// START Price Action Candles
|
||||
//////////////////////////////
|
||||
//
|
||||
// Retrieve Specific Candle Height (based on low and high) ...
|
||||
getCandleRange() =>
|
||||
high - low
|
||||
|
||||
//
|
||||
// Retrieve Candle Ranges Thirs Section ...
|
||||
getCandleThird() =>
|
||||
getCandleRange() / 3
|
||||
|
||||
//
|
||||
// Determines a Candle is Bullish or not ...
|
||||
isBullishCandle() =>
|
||||
close > low + (getCandleThird() * 2)
|
||||
|
||||
//
|
||||
// Determines a Candle is Bearish or not ...
|
||||
isNeutralCandle() =>
|
||||
close < low + (getCandleThird() * 2) and close > low + getCandleThird()
|
||||
|
||||
//
|
||||
// Determines a Candle is Neutral or not ...
|
||||
isBearishCandle() =>
|
||||
close < low + getCandleThird()
|
||||
/////////////////////////////
|
||||
// END Price Action Candles
|
||||
/////////////////////////////
|
||||
|
||||
//////////////////////
|
||||
// START Impuls MACD
|
||||
//////////////////////
|
||||
//
|
||||
calc_smma(src, len) =>
|
||||
float result = na
|
||||
rSma = ta.sma(src, len)
|
||||
result := na(result[1]) ? rSma : (result[1] * (len - 1) + src) / len
|
||||
result
|
||||
|
||||
//
|
||||
calc_zlema(src, length) =>
|
||||
ema1 = ta.ema(src, length)
|
||||
ema2 = ta.ema(ema1, length)
|
||||
d = ema1 - ema2
|
||||
result = ema1+d
|
||||
result
|
||||
//////////////////////
|
||||
// END Impuls MACD
|
||||
//////////////////////
|
||||
|
||||
//
|
||||
// END Functions ....
|
||||
//
|
||||
|
||||
//
|
||||
// START Calculations ....
|
||||
//
|
||||
//
|
||||
var shortColor = color.fuchsia
|
||||
var longColor = color.aqua
|
||||
|
||||
//////////////////////////////
|
||||
// START Price Action Candles
|
||||
//////////////////////////////
|
||||
//
|
||||
var bullishTitle = "Bullish"
|
||||
var bullishType = 1
|
||||
|
||||
//
|
||||
var bearishTitle = "Bearish"
|
||||
var bearishType = -1
|
||||
|
||||
//
|
||||
var neutralTitle = "Neutral"
|
||||
var neutralType = 0
|
||||
|
||||
//
|
||||
candleType = isBullishCandle() ? bullishType : isNeutralCandle() ? neutralType : isBearishCandle() ? bearishType : neutralType
|
||||
|
||||
//
|
||||
prevCandleType = not na(candleType[1]) ? candleType[1] : neutralType
|
||||
|
||||
//
|
||||
candleNeighborhoodBaseType = prevCandleType + candleType
|
||||
/////////////////////////////
|
||||
// END Price Action Candles
|
||||
/////////////////////////////
|
||||
|
||||
////////////////////////////
|
||||
// START Last Market Price
|
||||
////////////////////////////
|
||||
//
|
||||
lastMarketLowest = ta.lowest(low, swingLoopback)
|
||||
lastMarketLowest2 = ta.lowest(low, swingLoopback * 2)
|
||||
lastMarketLowest3 = ta.lowest(low, swingLoopback * 3)
|
||||
|
||||
//
|
||||
lastMarketHighest = ta.highest(high, swingLoopback)
|
||||
lastMarketHighest2 = ta.highest(high, swingLoopback * 2)
|
||||
lastMarketHighest3 = ta.highest(high, swingLoopback * 3)
|
||||
////////////////////////////
|
||||
// END Last Market Price
|
||||
////////////////////////////
|
||||
|
||||
////////////////////////////
|
||||
// START Trend Magic ...
|
||||
////////////////////////////
|
||||
TMAP = 5
|
||||
TMCoeff = 1
|
||||
TMPeriod = 18
|
||||
TMSrc = close
|
||||
|
||||
//
|
||||
TMATR = ta.sma(ta.tr,TMAP)
|
||||
|
||||
//
|
||||
TMUpT = low - TMATR * TMCoeff
|
||||
TMDownT = high + TMATR * TMCoeff
|
||||
|
||||
//
|
||||
TMMagicTrend = 0.0
|
||||
TMMagicTrend := ta.cci(TMSrc, TMPeriod) >= 0 ? (TMUpT < nz(TMMagicTrend[1]) ? nz(TMMagicTrend[1]) : TMUpT) : (TMDownT > nz(TMMagicTrend[1]) ? nz(TMMagicTrend[1]) : TMDownT)
|
||||
|
||||
//
|
||||
// Check Candle State based on TMMagic Trend ...
|
||||
TMCandleState = ta.cci(TMSrc, TMPeriod)
|
||||
|
||||
//
|
||||
TMTrendUp = TMCandleState > 0
|
||||
TMTrendDown = TMCandleState < 0
|
||||
TMTrendNeutral = TMCandleState == 0
|
||||
|
||||
//
|
||||
TMTrendDiff = TMMagicTrend - TMMagicTrend[1]
|
||||
|
||||
//
|
||||
TMTrendChanged = (TMTrendUp and not TMTrendUp[1]) or (TMTrendDown and not TMTrendDown[1])
|
||||
|
||||
//
|
||||
TMColor = TMTrendUp ? color.green : TMTrendDown ? color.red : TMTrendNeutral ? color.gray : na
|
||||
////////////////////////////
|
||||
// END Trend Magic ...
|
||||
////////////////////////////
|
||||
|
||||
///////////////////////
|
||||
// START Cycle Channel
|
||||
///////////////////////
|
||||
//
|
||||
CCHSclT = 10
|
||||
CCHMclT = 30
|
||||
CCHScm = 1.0
|
||||
CCHMcm = 3.0
|
||||
CCHSrc = close
|
||||
CCHEbc = false
|
||||
|
||||
//
|
||||
CCHScl = CCHSclT / 2
|
||||
CCHMcl = CCHMclT / 2
|
||||
|
||||
//
|
||||
CCHMaScl = ta.rma(CCHSrc, CCHScl)
|
||||
CCHMaMcl = ta.rma(CCHSrc, CCHMcl)
|
||||
|
||||
//
|
||||
CCHScmOff = CCHScm * ta.atr(CCHScl)
|
||||
CCHMcmOff = CCHMcm * ta.atr(CCHMcl)
|
||||
|
||||
//
|
||||
CCHScl2 = CCHScl / 2
|
||||
CCHMcl2 = CCHMcl / 2
|
||||
|
||||
//
|
||||
CCHSct = nz(CCHMaScl[CCHScl2], CCHSrc) + CCHScmOff
|
||||
CCHScb = nz(CCHMaScl[CCHScl2], CCHSrc) - CCHScmOff
|
||||
|
||||
//
|
||||
CCHMct = nz(CCHMaMcl[CCHMcl2], CCHSrc) + CCHMcmOff
|
||||
CCHMcb = nz(CCHMaMcl[CCHMcl2], CCHSrc) - CCHMcmOff
|
||||
|
||||
//
|
||||
CCHScmm = math.avg(CCHSct, CCHScb)
|
||||
|
||||
//
|
||||
CCHOmed = (CCHScmm - CCHMcb) / (CCHMct - CCHMcb)
|
||||
CCHOshort = (CCHSrc - CCHMcb) / (CCHMct - CCHMcb)
|
||||
|
||||
//
|
||||
CCHSlowOSC = CCHOmed
|
||||
CCHFastOSC = CCHOshort
|
||||
|
||||
//
|
||||
CCHMidPoint = 0.5
|
||||
isCCHUpTrend = CCHFastOSC > CCHMidPoint
|
||||
isCCHDownTrend = CCHFastOSC < CCHMidPoint
|
||||
CCHTrendUp = ta.crossover(CCHFastOSC, CCHMidPoint)
|
||||
CCHTrendDown = ta.crossunder(CCHFastOSC, CCHMidPoint)
|
||||
CCHTrendBullish = ta.crossover(CCHFastOSC, CCHSlowOSC) and isBullishCandle()
|
||||
|
||||
//
|
||||
CCHFastOSCDiff = CCHFastOSC - CCHFastOSC[1]
|
||||
CCHSlowOSCDiff = CCHSlowOSC - CCHSlowOSC[1]
|
||||
|
||||
//
|
||||
CCHBc = (CCHOshort > 0.5) ? (CCHOshort > 1.0 ? color.purple : (CCHOshort > CCHOmed ? color.lime : color.green)) : (CCHOshort < 0 ? color.purple : ( CCHOshort < CCHOmed ? color.red : color.orange))
|
||||
///////////////////////
|
||||
// END Cycle Channel
|
||||
///////////////////////
|
||||
|
||||
//////////////////////
|
||||
// START Impuls MACD
|
||||
//////////////////////
|
||||
//
|
||||
IMPMACDLengthMA = 34
|
||||
IMPMACDLengthSignal = 9
|
||||
|
||||
//
|
||||
IMPMACDSrc = hlc3
|
||||
IMPMACDHi = calc_smma(high, IMPMACDLengthMA)
|
||||
IMPMACDLo = calc_smma(low, IMPMACDLengthMA)
|
||||
IMPMACDNi = calc_zlema(IMPMACDSrc, IMPMACDLengthMA)
|
||||
|
||||
//
|
||||
IMPMACDMd = (IMPMACDNi > IMPMACDHi) ? (IMPMACDNi - IMPMACDHi) : (IMPMACDNi < IMPMACDLo) ? (IMPMACDNi - IMPMACDLo) : 0.0
|
||||
IMPMACDSb = ta.sma(IMPMACDMd, IMPMACDLengthSignal)
|
||||
IMPMACDSh = IMPMACDMd - IMPMACDSb
|
||||
|
||||
//
|
||||
IMPMACDIsBullish = (ta.crossunder(IMPMACDSb, IMPMACDMd) or ta.crossunder(IMPMACDSb[1], IMPMACDMd) or ta.crossunder(IMPMACDSb[2], IMPMACDMd)) and IMPMACDMd < 0 and IMPMACDSh > 0.1 and IMPMACDSb < IMPMACDMd and IMPMACDMd < -0.6
|
||||
IMPMACDIsBearish = (ta.crossover(IMPMACDSb, IMPMACDMd) or ta.crossover(IMPMACDSb[1], IMPMACDMd) or ta.crossover(IMPMACDSb[2], IMPMACDMd)) and IMPMACDMd > 0 and IMPMACDSh < -0.1 and IMPMACDSb > IMPMACDMd and IMPMACDMd > 0.6
|
||||
//////////////////////
|
||||
// END Impuls MACD
|
||||
//////////////////////
|
||||
|
||||
///////////////////////
|
||||
// START Strategy ...
|
||||
///////////////////////
|
||||
//
|
||||
canShowStopLoss = showSignals and showStopLosses and (showLongSignals or showShortSignals) and (showLongStopLosses or showShortStopLosses)
|
||||
canShowLongStopLoss = canShowStopLoss and showLongStopLosses
|
||||
canShowShortStopLoss = canShowStopLoss and showShortStopLosses
|
||||
|
||||
//
|
||||
hasLongSignal = IMPMACDIsBullish and TMTrendUp and isBullishCandle() // and open < TMMagicTrend
|
||||
longSignal = hasLongSignal ? bar_index : na
|
||||
float longStopLoss = lastMarketLowest
|
||||
|
||||
//
|
||||
hasShortSignal = IMPMACDIsBearish and TMTrendDown and isBearishCandle() // and open > TMMagicTrend
|
||||
shortSignal = hasShortSignal ? bar_index : na
|
||||
float shortStopLoss = lastMarketHighest
|
||||
|
||||
//
|
||||
hasSignal = hasLongSignal or hasShortSignal
|
||||
|
||||
//
|
||||
canShowSignal = showSignals and (showLongSignals or showShortSignals)
|
||||
canShowLongSignal = canShowSignal and showLongSignals and hasLongSignal
|
||||
canShowShortSignal = canShowSignal and showShortSignals and hasShortSignal
|
||||
///////////////////////
|
||||
// END Strategy ...
|
||||
///////////////////////
|
||||
//
|
||||
// END Calculations ....
|
||||
//
|
||||
|
||||
//
|
||||
// START Plots ....
|
||||
//
|
||||
//
|
||||
// Signals ...
|
||||
plotshape(canShowLongSignal ? longSignal : na, title = "Long Signal", color = longColor, location = location.belowbar, style = shape.triangleup, size = size.normal)
|
||||
plotshape(canShowShortSignal ? shortSignal : na, title = "Short Signal", color = shortColor, location = location.abovebar, style = shape.triangledown, size = size.normal)
|
||||
|
||||
//
|
||||
// Stop Losses ...
|
||||
plot(series = canShowLongStopLoss ? longStopLoss : na, color = color.fuchsia, linewidth = 1, style = plot.style_stepline, title = "Long Stop Loss")
|
||||
plot(series = canShowShortStopLoss ? shortStopLoss : na, color = color.aqua, linewidth = 1, style = plot.style_stepline, title = "Short Stop Loss")
|
||||
//
|
||||
// END Plots ....
|
||||
//
|
||||
|
||||
//
|
||||
// START Alerts ...
|
||||
//
|
||||
alertcondition(hasSignal, "XST_SHULL5M > Signal")
|
||||
alertcondition(hasLongSignal, "XST_SHULL5M > Long Signal")
|
||||
alertcondition(hasShortSignal, "XST_SHULL5M > Short Signal")
|
||||
//
|
||||
// END Alerts ...
|
||||
//
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// TODOS:
|
||||
// -------
|
||||
// - []
|
||||
//////////////////////////////////////////////////////
|
||||
Reference in New Issue
Block a user