Specification
Dear Fedor,
you finished my EA - very good programming, but I made some big mistakes there.
Now I have a new idea:
Main Description "EA Breakout with DynamicTP/SL":
My EA – idea is, that if the price crosses the MA-Line from down to up or up to down then the EA places the order (Sell/Buy, see Part C).
The profit-management depends from the value „S2“. The rules for this management I will explain it in Part D.
Part A.
|
|
Variable |
Value-input |
Main properties: |
============================= |
Magic: |
Input Magic Number |
EA comment: |
Input comment |
Time frame (Standard: „M5“): |
Select value (M1/M5/M15/M30/H1/H4/D1/WN) |
Max. Spread (SMAX): |
Input value |
RMM - Risk-Money-Management (true/false) |
Select value („true“ or “false“) |
Percentage Risk |
Input value |
Fixed Lot (if RiskMM=false) |
Input value |
MA (Default = 200) |
Input value |
MA method (Default = Simple) |
Select value |
MA (Default= Median Price HL/2) |
Select value |
„SOR“ (StartOrderRoutine-value) (Default = 220) |
Input value |
SLS1: Stoploss in % from Variable „S1“ |
Input value |
TSLS2: Trailing-SL-“Jump-in“ in % from Variable „S2“ (Default = 35) |
Input value |
TSTEP: Trailing-SL-Steps after „SL-jump-in“ in % from Variable „S2“ Default (= 10) |
Input value |
Trading time (true/false) |
Select value („true“ or “false“) |
Time setting Start (Default: 00:15) |
Input value |
Time setting End (Default: 22:45) |
Input value |
Part B.
After doing all the inputs (Part A), the EA has to wait until the price crosses the MA-Line.
If this happens, this point will be named: C(urrent)C(rossover)P(oint) – „CCP“.
After the price crossing the MA-Line again, the value „CCP“ should be renamend in L(ast)C(rossover)P(oint) – LCP and the current crossing-point will be namend in „CCP“.
Then the last high between the LCP an CCP is calculated by using the FIBO-Tool (see picture), it will be namend „F0“ (Fibo-Zero-Point).
Calculate „S1“-value: S1 = F0 – CCP
If S1 - SOR <= 0 „wait“, else „Start-Order“ - Routine
Part C
„Start-Order“-Routine
„Sell or Buy“ – Routine: If the price crosses the CCP from up to down, then „Sell“-Order, if vice versa then „Buy“ – Order, depending from Risk-Money-Management-inputs.
Part D
„Stop-Loss and Trailing-SL“ - Routine
S2 = F1 - CCP
SL (Stoploss) = (SLS1 * S1 / 100)
TS (Trailing-Start) = (TSLS2 * S2 / 100)
if price > (TSLS2 * S2 / 100) then set TS to this price, after this, use TSTEP until the SL is reached.
Then continue with B.3.
***END***
Have a nice week-end....
many greetings from Berlin...
MarcGiu