Specification
1. PROJECT OVERVIEW
Development of a custom automated and manual trading bot for NinjaTrader 8, primarily designed for Nasdaq Futures (NQ/MNQ).
The bot will contain the original trading strategy, configurable risk management, automatic and manual operating modes, alerts, profit/loss management, partial profit taking, Break Even, backtesting functionality, and the additional configurable contract-averaging system requested by the client.
The bot must be highly configurable so the user can adjust important parameters without modifying the source code.
The user interface and user-facing configuration should be in Spanish.
2. PLATFORM AND INSTRUMENTS
- Platform: NinjaTrader 8
- Primary instruments: NQ and MNQ (Nasdaq Futures)
- The bot must be developed specifically for NinjaTrader 8.
- The bot must be suitable for testing/backtesting through NinjaTrader 8.
- The source code must be delivered unlocked/editable so additional features can be added in the future.
The bot must have two main operating modes:
A. AUTOMATIC MODE
When Automatic Mode is activated:
- The bot analyzes the market automatically.
- It checks the programmed strategy conditions.
- When all required conditions are satisfied, the bot automatically executes the trade.
- The user configures the desired parameters before activating Automatic Mode.
- The bot then operates according to those selected parameters.
- The user should not need to manually execute every signal.
- Automatic Mode is intended to help the user avoid emotional/psychological interference while trading.
- The bot must automatically manage the position according to the configured Stop Loss, Take Profit, Break Even, partial profit, averaging and risk rules.
- Automatic Mode should stop trading when the configured daily profit objective or daily loss limit is reached.
- The user must be able to activate Automatic Mode again later when desired.
B. MANUAL MODE
When Manual Mode is selected:
- The bot analyzes the market according to the same strategy.
- The bot does not automatically execute the trade.
- When a valid trading opportunity appears, the bot sends an alert.
- The user decides whether to execute the trade manually.
- The relevant risk-management settings should also be available in Manual Mode.
- The user should be able to configure Stop Loss, Take Profit and loss limits for Manual Mode.
The bot must incorporate the original strategy discussed.
EMA 50 / EMA 200
- EMA 50
- EMA 200
These are part of the market/trend conditions used by the strategy.
SWEEP LOGIC
The bot must identify the required sweep setup according to the strategy rules before considering an entry.
ATR FILTER
- ATR must be included as part of the strategy.
- ATR multiplier: 1.5.
ADX FILTER
- ADX must be included as a market-condition filter.
- The ADX threshold should be configurable.
VOLUME FILTER
The original volume requirement is:
Volume > 1.2 × Average Volume
The bot should compare current volume with the relevant average volume and only allow the setup when the required volume condition is satisfied.
CORRELATION CONTROL
- Include the specified correlation limit/control from the original strategy.
- The purpose is to prevent unwanted correlated exposure according to the strategy rules.
The bot must support a configurable Stop Loss.
Original Stop Loss specification:
- 40 ticks.
The Stop Loss should be configurable from the bot's settings rather than permanently locked in the source code.
The original strategy uses:
- Take Profit = 2.5R.
The client also requested that Take Profit be configurable.
The user should be able to determine the desired Take Profit according to the available configuration.
When the trade reaches:
- 1R
The bot must move the Stop Loss to Break Even according to the strategy rules.
At:
- 1.5R
The bot must:
- Close 50% of the open position.
- Keep the remaining 50% running.
The remaining position should continue toward the larger target:
- 2.5R.
The original risk specification discussed:
- 1–2% risk per trade.
The risk percentage must be configurable.
The user specifically wants the ability to manually configure the loss/risk percentage even when Automatic Mode is being used.
The original strategy included:
- 3% daily loss limit.
However, the client subsequently requested that this value be configurable.
Therefore:
- The daily loss limit must be configurable.
- The user decides how much loss is acceptable.
- The limit should be configurable in the relevant amount/percentage format.
- Once the configured daily loss limit is reached, the bot must stop further trading according to the configured rules.
- The daily loss control must work with both Automatic Mode and Manual Mode where applicable.
The bot must support a configurable daily profit target.
The client gave:
- €1,500
as an example of the desired daily profit target.
The €1,500 value should not necessarily be permanently fixed.
The user must be able to configure the desired profit objective.
Desired behavior:
- User configures the desired daily profit target.
- Automatic Mode is activated.
- Bot executes trades according to the strategy.
- The bot manages the trades according to the configured settings.
- Once the configured profit target is reached, the bot closes/manages the relevant open position according to the programmed rules.
- The bot stops further trading for the day once the daily target is reached.
- The user can activate the bot again later when desired.
The bot must provide profit/loss information.
The client specifically requested that profit and loss be available in:
- Euros (€)
- Percentage (%)
The system should calculate/display the relevant profit and loss according to the configured parameters.
The user should be able to configure the desired profit and loss limits.
The client added an additional feature called contract averaging.
By averaging, the client means:
When the bot enters a trade and the market moves against the position, the bot automatically adds additional contracts according to the user's configuration.
Desired behavior:
- Bot enters the initial trade.
- Price moves against the position.
- The bot detects the configured averaging condition.
- The bot automatically adds the configured number of contracts.
- If the market continues moving against the position and another averaging condition is reached, the bot can add contracts again according to the configured rules.
- The process continues according to the configured averaging parameters and risk limits.
- The position is managed toward the configured profit objective.
The number of contracts used for averaging must be configurable.
Example given by the client:
If the user configures:
- 2 averaging contracts
the bot should add:
- 2 contracts
when the averaging condition is triggered.
If the user configures:
- 1 averaging contract
the bot should add:
- 1 contract.
Therefore, the number of averaging contracts must not be permanently fixed in the code.
The user must be able to configure this before activating Automatic Mode.
The averaging system must work together with the configurable profit objective.
Example:
- Automatic Mode is activated.
- Bot enters a trade.
- Price moves against the position.
- Bot automatically averages according to the configured number of contracts.
- The position continues to be managed.
- When the configured profit objective is reached, the bot closes the relevant position.
- If the daily profit target has been reached, the bot stops trading for the day.
The client used:
- €1,500
as an example of the desired profit target.
This value must remain configurable.
The averaging system must operate together with the loss-management system.
The bot must respect the configured loss/risk limits.
The averaging system should not continue adding contracts without respecting the configured risk controls.
The final averaging implementation must include the appropriate protection against excessive exposure.
The following specific averaging parameters still require final confirmation if they were not defined elsewhere:
- Exact distance between averaging entries.
- Maximum number of averaging entries.
- Maximum total number of contracts.
- Exact condition that triggers each averaging entry.
- Exact behavior when the daily loss limit is reached during an averaging sequence.
These values should not be assumed without confirmation.
Before activating Automatic Mode, the user should be able to configure the relevant parameters.
These include, where applicable:
- Risk percentage.
- Daily loss limit.
- Daily profit target.
- Stop Loss.
- Take Profit.
- Break Even settings.
- Partial profit settings.
- Number of averaging contracts.
- Other strategy parameters.
- Relevant contract/risk limits.
After the user activates Automatic Mode, the bot follows those configured settings.
Automatic Mode must be able to stop according to the configured limits.
Important stop conditions include:
- Daily profit target reached.
- Daily loss limit reached.
- Other relevant risk-control conditions configured by the user.
After stopping, the bot should remain inactive until the user decides to activate it again.
Manual Mode must provide alerts.
When a valid setup appears:
- Bot identifies the opportunity.
- Bot sends an alert.
- User decides whether to execute the trade.
The bot should not automatically execute the trade while Manual Mode is active.
The client specifically requested configurable loss controls for both:
- Automatic Mode.
- Manual Mode.
Therefore, the relevant settings should be available in both modes.
These include:
- Risk/loss limits.
- Stop Loss.
- Take Profit.
- Profit target.
- Daily loss control.
The client specifically requested:
"Todo sea en español."
Therefore, all user-facing elements should be in Spanish as much as technically possible.
This includes:
- Settings.
- Configuration labels.
- User-facing parameters.
- Alerts.
- Relevant messages.
- Controls.
- Descriptions.
The bot must be suitable for backtesting through NinjaTrader 8.
Testing should cover:
- EMA 50 / EMA 200.
- Sweep logic.
- ATR filter.
- ATR multiplier.
- ADX filter.
- Volume filter.
- Correlation control.
- Entry conditions.
- Stop Loss.
- Take Profit.
- Break Even.
- Partial profit.
- Automatic Mode.
- Manual Mode alerts.
- Daily profit target.
- Daily loss limit.
- Contract averaging.
- Different averaging contract quantities.
- Risk-management behavior.
The averaging system must also be tested under different market conditions to verify that the programmed rules operate as intended.
The bot must be prepared for installation/import into NinjaTrader 8.
The client previously asked whether he would have problems installing the bot.
The project should therefore include appropriate assistance with:
- Installing/importing the bot.
- Configuring the bot.
- Setting the required parameters.
- Resolving reasonable installation/configuration issues if they occur.
The client specifically requested that the source code not be locked.
Therefore:
- Source code must be delivered.
- Source code must remain editable.
- No intentional source-code lock should prevent future modifications.
- The client should be able to use the source code for future development/modifications.
- Additional features can be added in future projects if agreed upon.
The client explained that he intends to use the Automatic Mode mainly for funded trading accounts.
Therefore, risk-management functionality is particularly important.
The bot should provide configurable controls for:
- Daily loss limit.
- Profit target.
- Risk percentage.
- Contract quantity.
- Averaging quantity.
- Relevant exposure limits.
The bot itself does not guarantee that a funded-account evaluation will be passed. It will operate according to the programmed strategy and the limits configured by the user.
The following parameters should be available/configurable where applicable:
- EMA 50.
- EMA 200.
- Sweep conditions.
- ATR filter.
- ATR multiplier.
- ADX threshold.
- Volume multiplier.
- Correlation limit.
- Stop Loss.
- Take Profit.
- Risk percentage.
- Daily loss limit.
- Daily profit target.
- Break Even.
- Partial profit.
- Averaging contract quantity.
- Relevant averaging limits.
- Trading mode.
- Alert settings.
The original strategy values discussed are:
- EMA: 50 / 200.
- ATR multiplier: 1.5.
- Volume: greater than 1.2 × average volume.
- Stop Loss: 40 ticks.
- Take Profit: 2.5R.
- Break Even: 1R.
- Partial close: 50% at 1.5R.
- Remaining position: 50% toward 2.5R.
- Risk per trade: approximately 1–2%.
- Daily loss limit: approximately 3%.
- Example daily profit target: €1,500.
- Averaging contracts: configurable.
Where the client requested that these values be configurable, they should be implemented as configurable parameters rather than permanently fixed values.
The completed NinjaTrader 8 bot should provide:
- NQ/MNQ trading support.
- EMA 50/200 strategy conditions.
- Sweep logic.
- ATR filtering.
- ATR multiplier configuration.
- ADX filtering.
- Configurable ADX threshold.
- Volume filtering.
- Volume > 1.2 × average-volume condition.
- Correlation control.
- Configurable Stop Loss.
- Original 40-tick Stop Loss reference.
- Configurable Take Profit.
- 2.5R original Take Profit target.
- Break Even at 1R.
- 50% partial close at 1.5R.
- Remaining 50% toward 2.5R.
- Configurable risk percentage.
- Configurable daily loss limit.
- Original 3% daily loss reference.
- Configurable daily profit target.
- Example €1,500 profit target.
- Profit/loss calculation in €.
- Profit/loss calculation in %.
- Automatic Mode.
- Manual Mode.
- Manual trading alerts.
- Automatic trade execution.
- Configurable contract averaging.
- Configurable number of averaging contracts.
- Automatic averaging when price moves against the position.
- Averaging integrated with profit/loss controls.
- Automatic stop after configured daily target/loss limit.
- Spanish user-facing interface.
- NinjaTrader 8 backtesting support.
- Installation/configuration assistance.
- Unlocked/editable source code.
- Ability to add future functionality.
To make sure there is no misunderstanding during development, the following averaging rules should be confirmed:
- How many ticks/points must price move against the position before the first averaging entry?
- How many ticks/points should separate each additional averaging entry?
- What is the maximum number of averaging entries allowed?
- What is the maximum total number of contracts allowed?
- What should happen if the daily loss limit is reached while an averaging sequence is active?
- Is the €1,500 target intended as the total daily account profit target, the target for one individual position, or both?
- Should the averaging system operate with both NQ and MNQ?
- Should averaging be available only in Automatic Mode, or also in Manual Mode?
These points should be confirmed before the averaging logic is considered completely finalized.
Please review the requirements above and confirm that they accurately represent everything you want included in the bot.
Any additional functionality not included in this specification should be discussed and agreed upon before implementation so that the development scope remains clear for both sides.
The objective is to make sure the final bot matches the agreed requirements as closely as possible and that both parties have the same understanding of the project before development is completed,
( also i forgot to add " EMA 20 in the pullback together with the EMA 50 and EMA 200.” )