Termos de Referência
I have a trading strategy using two custom indicators that I would like be converted into an EA.
There are technically two trading strategies that can be used or a combination of entry and exit conditions.
Each trading strategy has its own entry and exit conditions, and I would like the user to be able to select which entry and exit conditions they want to use (confluence open, confluence close, reversal open, reversal close)
______________________________________________________________________________________________________
Definitions:
Reversal Zones are simply an ATR multiple of the middle TMA Band.
The 'Sell' "Reversal Zone" is between the 5x ATR multiple and the 2x ATR multiple of the TMA
The 'Buy' "Reversal Zone" is between the -5x ATR multiple and the -2x ATR multiple of the TMA
The Middle band is the TMA (Triangular Moving Average)
______________________________________________________________________________________________________
Trading Strategies:
First Trading Strategy with visual representation of confluence open and close.
Strategy Notes: The confluence strategy is best for swing trading on larger timeframes like H1 - D1 but can be used on timeframes down to M15
Confluence Long Entry Conditions:
1. Price enters "Reversal Zone"
2. AND Price is below middle TMA line
3. AND middle TMA line is trending 'UP' (lime-green)
4. AND Smoothed ATR Trend Envelopes changes from 'down' to 'up'
5. If all conditions are true, enter a long position on the following candle open
Confluence Long Exit Conditions:
1. Price enters "Reversal Zone"
2. AND Price is above middle TMA line
3. AND middle TMA line is trending 'DOWN' (magenta)
4. AND Smoothed ATR Trend Envelopes changes from 'up' to 'down'
5. If all conditions are true, exit long position on following candle open
Taking short positions with the confluence strategy follows the same logic, just reversed.
1. Price enters "Reversal Zone"
2. AND Price is above middle TMA line
3. AND middle TMA line is trending 'DOWN' (magenta)
4. AND Smoothed ATR Trend Envelopes changes from 'up' to 'down'
5. If all conditions are true, enter a short position on the following candle open
Confluence Short Exit Conditions:
1. Price enters "Reversal Zone"
2. AND Price is below middle TMA line
3. AND middle TMA line is trending 'up' (lime-green)
4. AND Smoothed ATR Trend Envelopes changes from 'down' to 'up'
5. If all conditions are true, exit short position on following candle open
Second Trading Strategy with visual representation of reversal open and close:
Strategy Notes: With this particular strategy, every candle that closes inside the "Reversal Zone" is a buy or sell opportunity. I would like to have a "Maximum Orders Limit" input for the user to choose how many orders the EA can enter based on the entry conditions. Default will be 5.
Smoothed ATR Trend Envelopes are not used as part of this strategy.
Note: MACD can be used for reversal confirmation but is optional to the strategy and is usually lagging the reversal trade.
Reversal Short Entry Conditions:
1. If there are no open short positions
2. AND price closes in 'Sell' "Reversal Zone"
3. AND TMA is 'DOWN'
4. Enter a short position on the open of the next candle.
Reversal Short Exit Conditions:
1. When price closes in 'Buy' "Reversal Zone", close all open short positions on the open of the next candle.
Reversal Long Entry Conditions:
1. If there are no open long positions
2. AND price closes in 'Buy' "Reversal Zone"
3. AND TMA is 'UP'
4. Enter a long position on the open of the next candle.
Reversal Long Exit Conditions:
1. When price closes in 'Sell' "Reversal Zone", close all open long positions on the open of the next candle.
_______________________________________________________________________________________________
Additional Requirements:
I would like an information panel to be visible to the user similar to this one:
I would like these particular properties listed:
EA state: (running/not running) is the EA active and running
Algo Trading: (true/false) is algo trading turned on
Magic ID: (integer)
TMA Trend Direction: (Up/Down) determined by the middle TMA trend direction
SATRTE Trend Direction: (Up/Down) determined by the Smoothed ATR Trend Envelopes of Averages trend direction
Price in Reversal Zone: (true/false) is the price in a reversal zone?
Reversal Zone: (Buy, Sell, None) which reversal zone is the price in
Reversal Zone Band: (2, -2, 2.6, -2.6, 3, -3, 3.4, -3.4, 3.8, -3.8, 4.2, -4.2, 4.6, -4.6, 5, -5) Reversal band last touched by price
Sentiment: (Buy, Sell) this depends on the entry condition selected by the user. See entry conditions.
Inputs:
I would like the user to have all the neccessary inputs to properly backtest the strategy.
Magic ID: (int)
TMA Period: (int)
ATR Period: (int)
ATR Multiplier: (double) the current "reversal zone" bands are statically calculated but i would like them to be calculated based off this multiplier so as this multiplier value changes, so do the multiples of the "reversal zone" bands. If you have questions regarding this, please ask.
Trend Threshold: (double) see indicator code for more context
Entry Condition: (string) enum: [indicator confluence, reversal zone]
Exit Condition: (string) enum: [indicator confluence, reversal zone]
Maximum Orders Limit: (int) default 5
Show Indicators: (boolean) plot indicators to chart
Use trading windows: (boolean)
Trading time start: (datetime)
Trading time end: (datetime)
Lot Calculation Method: (string) enum: [min lot size .01, custom lot size, percentage of balance]
Custom Lot Size: (double) only relevant if "custom lot size" is selected from above
Percentage of Balance per trade: (double) i.e. "1.00" = 1%, only relevant if "percentage of balance" is selected from above
Maximum Drawdown (%): (double) i.e. "30.0" = 30%
Maximum Daily Drawdown (%): (double)
Colors: (only relevant if user selects true on "Show Indicators")
TMA: (3 colors - TMA Up, TMA Down, TMA Neutral)
Sell Reversal Zone: (3 colors - Upper Band, Lower Band, Middle Bands)
Buy Reversal Zone: (3 colors - Upper Band, Lower Band, Middle Bands)
SATR Trend Envelopes: (2 colors - SATRTE up, SATRTE down)
SATR Trend Envelopes Start: (2 colors - SATRTE up start, SATRTE down start)
Any other inputs that you think might be helpful to the user, please let me know
______________________________________________________________________________________________________
The custom TMA indicator I use is adapted from a few sources but you can reference to get a good understanding of way the strategy works.