Buy against the trend and then switch
general:
If broker and my VPS server lose connection, the ea sends SMS to 3 phone numbers and email notice to 3 email addresses.
If broker loses connection to the market then the ea also sends the messages.
SOS button on the chart, in emergency to close all orders and stop the work of the ea.
Backtest should run fast as possible. Please code the ea so it runs fast.
Must be able to open multiple charts for different currency pairs to run at the same time. And must be able to open multiple charts for the same pair. Each chart looks at current balance for start lot size. We need ability to change magic number ourself please.
If the EA if closed and restarted in the middle of its work, it must remember its work and continue like normal when turned on again (in case of restart the server). This is critical.
Please use the input names provided in the Spec Doc.
Max DD close all positions from that chart only. Input MaxDDCloseChart. So if one chart positions reach the max DD, it closes only those positions on that chart, not all the positions.
MaxDDCloseALL. If this is reaches close all positions on all charts.
EA logic:
The EA opens positions against the trend. Each position has TP and SL (need inputs). If the market goes down open buys, if the market goes up open sells. All positions are market orders.
The positions are spaced with gaps. Ned input: PositionGaps
Start lot is calculated as % of current balance as of the time the ea starts.
Each time the EA begins to open opposite positions, it checks the balance to calculate the start lot for those new opposite positions.
(need input StartLotPercentBal). Eg $100,000 balance. If StartLotPercentBal = 1%, then start lot will be 1.0 lot size. If set StartLotPercentBal input = 0.25% Then start lot will be 0.25 lot
After a position is TP or SL, if the market will go back to the price where the position was located, the position opens again. This process repeats as many times without limit. The positions work independently, opening and closing (with TP or SL). Depending on the input settings we can have buys and sells open at the same time.
Let the profit run option: Provide inputs to lock profit and trail the SL. i.e. the TP must increase to infinity once the ea locks x pips profit. Inputs are: ProfitPipsToStartSLtrail, DistancePipsToSL, TrailSLStepPips.
Condition to switch and open positions WITH the trend: In the example below, position gap =10, TP = 10, SL = 40. DistanceToSwitch = 40. All the sells are closed with TP. We only have buys. The market continues down. The buys close with SL. The market continues down, more than X pips distance from the most losing active buy (input: DistanceToSwitch). Now we start opening sells (we have switched, we open WITH the trend). As long as the market continues lower, we open sells at the specified gaps. There is no limit to the number of sells that can open. When the market retraces back up at least 40 pips from the most losing sell (the lowest priced sell), then we switch and begin to open buys. This process of opening opposite orders continues. We do not open positions again against the trend until we restart the ea.
s closed with TP
s closed with TP
s closed with TP
s closed with TP market starts here, goes up and retraces all the way down.
b closed with SL this buy closes as the sell below opens.
b closed with SL
b closed with SL
b closed with SL
s closed with TP here we switch, open positions WITH the trend.
s closed with TP
s closed with TP
s closed with TP
s
market ends here
A) Need option to increase next lot size X percent bigger than the prior lot. (PercentLotIncrease) e.g.
= 20
start lot = 1 lot
1.2 lot
1.44 lot
1.728 lot
B) Need option to increase position gaps X percent bigger than the prior position gap. Opposite orders start with beginning size gap.
C) Need option to increase TP X percent bigger than prior position TP. Opposite orders start with with beginning TP
D) Need option to increase SL X percent bigger than prior position SL. Opposite orders start with with beginning SL
A,B,C,D above will all also decrease if input used is a negative number. E.G. -10.
Need T/F option to open the positions only after some distance retrace.
Need T/F input: OnlyOpenOnRetrace. Example: Set input = T, The market is going higher. We want to open sells (opening against the trend). Only open sells when the market goes up passed the price where it should open the sell (market passes by minimum x pips, need input: MinDistancePast) and then comes back down again to that price, only then it opens the sell. If the market does not retrace, we don’t open a sell at that location. Later, if the market retraces there, then the sell will open. If we have switched and we are opening positions WITH the trend, open the buy position immediately even if input OnlyOpenOnRetrace = T. However if the buy is TP (not SL), and the market retraces to the price where we re-open the buy, do not open the buy until the market drops below that price by MinDistancePast and retraces back up to the price where it should open the buy.
Info on the chart please show:
1. Net lot working. current DD each chart. Max DD each chart.
2. For the above numbers show totals for all account combined.
3. Free margin. Minimum free margin.
4. Closed profits each chart.