Script to test manually my indicators historical in strategy tester

MQL4 专家 脚本

指定

Hi everyone,


I want to manually test and analyze my indicators with the "Strategy tester".
It may be similar to the LFH Trading simulator. (Link: http://www.forexfactory.com/showthread.php?t=70742)

I have already tried several simulators. Unfortunately, I found no one who does what I want.

I need an EA (like LFH) and two scripts (long and short) that trigger a market order and simultaneously show two lines representing the stop and the target.
By positioning the stop, the Lot Size is calculated. The target and the stop must always be displaceable or customizable. Simply by moving the lines up or down. On the left of the target line, the risk/reward ratio should be displaced (e.g. 3.6). If I move the target, the display of the risk/reward ratio have to be adjusted or updated.

What variables should be set in the EA.
1. Risk in Percent
2. Target sell 50% or 100% of the position
3. Color Target
4. Color Stop

The lot size is calculated by the difference between the open of the next bar with the distance to the stop and the available capital.

Calculation Lot size:
Buy Example:
1.2500 = Open next bar, 1.2450 stop line, $ 10.000 account, risk 2%


Maximum position size =
  ((10,000 $ * 2% stop loss) / 50 pips SL) / ((100,000 / 1.25) * 0.0001) = 0.5 Lot

Specific number formula:
((10000 * 0.02) / 50) / ((100,000 / 1.25) * 0.0001) = 0.5 Lot
I hope I have this right.


Function next bar in the EA:
I do not care what happens in the next bar. Therefore, I need an implementation of this function is to go to the close of the bar and then the startegietester goes into pause mode. I click play again and it goes back to the close of the bar.
Example script with the problem here is the 14400. I have always adjust the variable if I go to a different period. for example from 4 hours to 5 minutes. This should take into account the new script.
// Break programs
    pausetime = TimeToStr (Time [0], TIME_DATE | TIME_MINUTES);
    Alert (pause time);
    if (pausetime> = pausetimenew)
      {
       Comment ("Next Stop" + pausetimenew);
       keybd_event (19,0,0,0);
       Sleep (1);
       keybd_event (19,0,2,0);
       pausetimenew = TimeToStr (Time [0] + 14400, TIME_DATE | TIME_MINUTES);
       // Note seconds adjust as required
      }

If you have any questions, just post here.

反馈

1
开发者 1
等级
项目
0
0%
仲裁
0
逾期
0
空闲
2
开发者 2
等级
(128)
项目
236
65%
仲裁
30
37% / 23%
逾期
49
21%
空闲
3
开发者 3
等级
(219)
项目
370
42%
仲裁
145
17% / 41%
逾期
124
34%
空闲
发布者: 38 代码
4
开发者 4
等级
项目
0
0%
仲裁
0
逾期
0
空闲
5
开发者 5
等级
(64)
项目
144
46%
仲裁
19
42% / 16%
逾期
32
22%
空闲

项目信息

预算
20 - 100 USD
截止日期
 1  5 天