Техническое задание
Scalp on any timeframe based on SMA with 3 level Martingale or 1 level Hedge as recovery options
Enter a trade when the price/candle close is at a certain distance range from a defined period SMA value.
If the trade SL is hit and recovery is on then based on the chosen method of recover. place orders.
News filter and weekend close options are also needed.
Details below.
https://docs.google.com/spreadsheets/d/1fdBvRkQEG1A1ftjw8Dzv8wiuY0rD05nHHXvX4rCojoM/edit?usp=sharing
More details
Basic Idea
Based on the option chosen (Price or Close) on every bar check for the entry criteria and open a Buy or a Sell trade.
Only enter trades if
*No trades are currently open on the pair and
*Not in News filter time frame
If last trade on the pair was closed due to SL
If SL was hit for a Sell trade do not open a trade until the current candle closes below the SMA line
if SL was hit for a Buy trade then do not open a trade till the current candle closes above the SMA line
Buy Entry
Price option
If current price < SMA and Distance between Current Price and SMA is between a user defined range provided in input settings (in Pips)
Close Option
If Close price < SMA and Distance between Current Price and SMA is between a user defined range provided in input settings (in Pips)
Sell Entry
Price option
If current price > SMA and Distance between Current Price and SMA is between a user defined range provided in input settings (in Pips)
Close Option
If Close price > SMA and Distance between Current Price and SMA is between a user defined range provided in input settings (in Pips)
Closing/Exiting a Trade (2 options)
-Price touches SMA
-TP in pips
Recovery Option – True/False
Martin
Can choose upto 3 levels
Open Buy Limit for First order buy and Sell Limit for First order Sell
User will define when the first recovery order will be placed (in Pips away from entry of the first order)
User will define the SL for each recovery Level
User will define final TP as user input.
User will input Mutliplication factor for lot sizes for each level (default 2)
Eg. For 2 it will be Level 1-2Xfirst order lot, Level2- 4XFirst order lot size, Level 3- 8X first order lot size
TP for each level
Level 1 – TP in user setting + Spread + SL for first order
Level 2 - TP in user setting + Spread + SL for first order + SL Recovery(lot size for first order/lot size for level 1)
Level 3 TP in user setting + Spread + SL for first order + SL Recovery(lot size for first order/lot size for level 1) + SL Recovery(lot size for first order/lot size for level 2)
Hedge
(based on recovery settings) Pips away from entry of the first order open a trade in the opposite direction @ twice the lot size of the first order with user enter SL and TP
TP for the hedge should be calculated based on
Recovery TP in the settings + (stoploss of the first order/2) + slippage
SL (for first order not recovery)
- Fixed Pips
Lot sizing
- Risk % of account balance (calculate lot size with the percentage and default to 0.01 (0.02 if partial close is enabled)
Calculation for lot size
No recovery
If Risk_Percent*Account_Balance/(100*SL_Pips*Pip_Value of the Pair in Account_Currency)> 0.01 then that calculated value else 0.01
With Recovery
If Risk_Percent*Account_Balance/(100*Max_SL*Pip_Value of the Pair in Account_Currency)> 0.01 then that value else 0.01
Max_SL by levels for recovery
Level 1
First order Stop Loss + ((level1 lot size/fisrt order lot size)*SL_Recovery)
Level 2
First order Stop Loss + ((level1 lot size/fisrt order lot size)*SL_Recovery)+((level2 lot size/fisrt order lot size)*SL_Recovery)
Level 3
First order Stop Loss + ((level1 lot size/fisrt order lot size)*SL_Recovery)+((level2 lot size/fisrt order lot size)*SL_Recovery)+((level3 lot size/fisrt order lot size)*SL_Recovery)
- Fixed Lot size
Break Even - Break even type (pips or % of account profit) - value 0 in both values below will disable the options
- Break Even Pips (at what Pips to move SL to Break Even)
- Lock in pips for Break Even (to cover for commission and swap ) user defined pip count
News Filter (disable making new entries during news) - True or False
if True
- Close Positions in Profit (if in Min Profit or in Pips provided in user setting) - True or False
- Min Profit to close positons (value in pips)
- Move SL to Max SL (Move SL of losing positons to a MaxSL value if the current stop loss is greate than Max SL value - True/False
- Max SL
- do not enter any new trades during news
- Time before news (in minutes) - not to trade
- Time after news (in minutes) - not to trade
- Level of news (High, Med, Low) a lower level should include all above levels. eg, if Med is chosen then High and Med type of news should be considered to perform step for news.
Friday Close Yes/No "Close all profit positions on Friday and move SL to set level for losing trades(like the news one)"
TP_Open_FC "in Pips Minimum profit Pip to close postions before Friday EOD"
Max_SL_Level_FC 10 "Max stop loss level from current price before Friday EOD SL for losing trades should be move to 10 if the absolute value of (current price-SL) is > 10 pips"
Other Setting
- Account Currency (Should work for USD, CAD accounts) - this setting will help in calculating Lot size based on risk
- Pair Type (Should work for 3 or 5 digit , 4 digit, Gold, Silver)
- Hard Stop % - (% of account balance to stop EA from wiping out the account )
Display on Chart
EA Name - SMA SScalp EA
- Account Equity in $ (account currency)
- Account Balance in $ (account currency)
- Current FL Profit/Loss in $ (account currency)
- Current Stop Loss - in $ (account currency)
- Current Stop Loss - In Pips