1. Introduction and structure
Your strategy is divided into several logical blocks, each block corresponding to a specific trading configuration (e.g. ‘Long_1’, ‘Long_2’, etc.). These configurations follow the same pattern:
Entry conditions (long/short): Based on the price position between predefined levels (LongRangeHigh, LongRangeLow, etc.) and a cross of EMA9 and SMA6 indicators.
Exit conditions: Conditional closing of a position if certain conditions are met (positive profit, inverse cross, etc.).
Stop Loss (SL) and Take Profit (TP): Defined by fixed levels for each configuration.
2. Technical indicators
You use two main indicators:
EMA9: Exponential moving average calculated over 9 periods.
SMA6: Simple moving average calculated over 6 periods.
These indicators are used to detect crossovers for entry and exit signals. The EMA9 crossover above the SMA6 triggers long opportunities, while the opposite crossover generates exit signals.
3. Price ranges and trading logic
For each ‘block’ in the strategy :
Price ranges are defined (LongRangeHigh, LongRangeLow, etc.) to determine where the price must be to execute a position.
Each range is divided into levels for long and short positions.
Example: Block 1
Long Range: Between 9.3 (LongRangeLow) and 10.85 (LongRangeHigh).
Short Range: Between 10.85 (ShortRangeLow) and 11.70 (ShortRangeHigh).
Special features:
An EMA9 crossover above SMA6 in the Long Range generates a long entry.
An inverse cross in the Short Range generates a conditional output.
4. Risk management
Each position is associated with Stop Loss (SL) and Take Profit (TP) levels. These are defined as follows:
TP: Often equal to the upper limit of the Long Range or Short Range.
SL: Based on the lower levels of the ranges or other configurations.
Example: Block 1
TP set to LongRangeHigh (10.85).
SL could be adjusted according to ShortRangeHigh.
5. Visual display
The script uses plot to display the following elements on the chart:
The EMA9 (blue) and SMA6 (orange) indicators.
Price levels (LongRangeHigh, LongRangeLow, etc.) and SL/TP limits.
EDIT :
SMA: 1
EMA: 23
Period : From May 2024 to January 2024