增加EA簡單功能

2020.10.14 专家 脚本

指定

增加5個功能

1.  訂單6種類: 即時,等待

2.  時間開關 共5段 (星期一至五的開關)

3.  新聞過濾, 分別有1至3級,在有新聞前的多少小時停止交易或鎖倉

4.  保險機制

5.1 BOL

5.2 區間高低位


---------------------------------------------

增加EA功能的界面格式

1區

mySetting
Direction_Steps1
Direction_Lots1
Price_Points_Steps1
TP_Steps1
Trailing_stop_loss_1
Magic1
2區
在交易時間內=開/鎖/無
在交易時間外=開/鎖/無
Time_A_1 = True / Falue
From_Time_To_Time_A_1 = 00:00 - 01:00
Time_B_1 = True / Falue
From_Time_To_Time_B_1 = 01:00 - 02:00
Time_C_1 = True / Falue
From_Time_To_Time_C_1 = 02:00 - 03:00
Time_D_1 = True / Falue
From_Time_To_Time_D_1 = 04:00 - 05:00
Time_E_1 = True / Falue
From_Time_To_Time_E_1 = 05:00 - 06:00
MondayTrade_1 = True / Falue
TuesdayTrade_1 = True / Falue
WednesdayTrade_1 = True / Falue
ThursdayTrade_1 = True / Falue
FridayTrade_1 = True / Falue
SaturdayTrade_1 = True / Falue
SundayTrade_1 = True / Falue
3區
在新聞時間前分鐘=開/鎖/無
在新聞時間後分鐘=開/鎖/無
LowNews = True / Falue
Pause before a low news (Min.) = 240
Pause after a low news (Min.) = 240
MediumNews = True / Falue
Pause before a low news (Min.) = 240
Pause after a low news (Min.) = 240
HighNews = True / Falue
Pause before a low news (Min.) = 240
Pause after a low news (Min.) = 240
4區
觸發保險機制交易動作 = 開/鎖/無
保險機制 = True / False
時間範圍: 00:00-05:00
星期範圍: 1,3,5,7
日數: 3
價格波動率限制:200%
5區
BOL_A_1 = True / Falue
Bands Period_A_1 = 20
Bands Shift_A_1 = 0
Bands Deviations_A_1 = 2.0
Buy signal_open_A_1 = True / Falue
Buy signal_open_A_1_value: >=0
Buy signal_pause_A_1 = True / Falue
Buy signal_pause_A_1_value: >=0
Sell signal_open_A_1 = True / Falue
Sell signal_open_A_1_value: >=0
Sell signal_pause_A_1 = True / Falue
Sell signal_pause_A_1_value: >=0
MinimumBandSize_A_1 = 100
BOL_B_1 = True / Falue
Bands Period_B_1 = 20
Bands Shift_B_1 = 0
Bands Deviations_B_1 = 2.0
Buy signal_open_B_1 = True / Falue
Buy signal_open_B_1_value: >=0
Buy signal_pause_B_1 = True / Falue
Buy signal_pause_B_1_value: >=0
Sell signal_open_B_1 = True / Falue
Sell signal_open_B_1_value: >=0
Sell signal_pause_B_1 = True / Falue
Sell signal_pause_B_1_value: >=0
MinimumBandSize_B_1 = 100
在相同區間鎖倉上限 = 1
鎖倉與解倉的最少距離 = 100 
Zigzag_reopen_1 True / False
InpDepth_1 12
InpDeviation_1 5

InpBackstep_1 3


---------------------------------------------

EA功能說明:

1區說明:

1區:


我想EA可以執行6種訂單類型,目前EA只能執行buy和sell的即時執行訂單,但不能執行limit訂單和stop訂單.


請看圖1.png


事例1.1:

EA已經有這個功能

Direction_Steps1: buy buy buy buy buy

Direction_Lots1: 0.01 0.02 0.04 0.08 0.16

Price_Points_Steps1: 0 100 100 100 100

TP_Steps1: 100 100 100 100 100


EA沒有這個功能


Direction_Steps1: buystop buystop buystop buystop buystop

Direction_Lots1: 0.01 0.02 0.04 0.08 0.16

Price_Points_Steps1: 0 100 100 100 100

TP_Steps1: 100 100 100 100 100


Direction_Steps1: selllimit selllimit selllimit selllimit selllimit

Direction_Lots1: 0.01 0.02 0.04 0.08 0.16

Price_Points_Steps1: 0 100 100 100 100

TP_Steps1: 100 100 100 100 100


事例1.2:

Direction_Steps1: buy buy buy buy buy

Direction_Lots1: 0.01 0.02 0.04 0.08 0.16

Price_Points_Steps1: 0 -100 -100 -100 -100

TP_Steps1: 100 100 100 100 100


Direction_Steps1: buylimit buylimit buylimit buylimit buylimit

Direction_Lots1: 0.01 0.02 0.04 0.08 0.16

Price_Points_Steps1: 0 -100 -100 -100 -100

TP_Steps1: 100 100 100 100 100


Direction_Steps1: sellstop sellstop sellstop sellstop sellstop

Direction_Lots1: 0.01 0.02 0.04 0.08 0.16

Price_Points_Steps1: 0 -100 -100 -100 -100

TP_Steps1: 100 100 100 100 100

----------------------------------------------------------------

2區說明:

2區:


2區的EA界面:

在交易時間內=開/鎖/無

在交易時間外=開/鎖/無

Time_A_1 = True / False

From_Time_To_Time_A_1 = 00:00 - 01:00

Time_B_1 = True / False

From_Time_To_Time_B_1 = 01:00 - 02:00

Time_C_1 = True / False

From_Time_To_Time_C_1 = 02:00 - 03:00

Time_D_1 = True / False

From_Time_To_Time_D_1 = 04:00 - 05:00

Time_E_1 = True / False

From_Time_To_Time_E_1 = 05:00 - 06:00

MondayTrade_1 = True / False

TuesdayTrade_1 = True / False

WednesdayTrade_1 = True / False

ThursdayTrade_1 = True / False

FridayTrade_1 = True / False

SaturdayTrade_1 = True / False

SundayTrade_1 = True / False


開就是開倉


無就是不開倉和不鎖倉,只盈利


鎖倉動作說明: 如果盈利是100點,當日交易總手數是buy0.15,虧損20點,就在comment寫b15_100+20p_2345_0


(direction_tp-sl_magic number_order number),等到下一天開倉是buy0.15,以及更新盈利為120點.)



事例2.1:

如果EA設置是

Time_A_1 = True

From_Time_To_Time_A_1 = 00:00 - 09:00

MondayTrade_1 = True

TuesdayTrade_1 = True

其他都是False


如果盈利是100點,當日交易總手數是buy0.15,虧損20點時關閉交易,

等到下一天開倉是buy0.15為一張訂單,以及更新盈利,由100點改為120點.就在comment寫100+20p_1.


第二天,如果盈利是120點,當日交易總手數是buy0.18,虧損50點時關閉交易,

等到下一天開倉是buy0.18為一張訂單,以及更新盈利,由120點改為170點.就在comment寫120+50p_2.


事例2.2:

如果

MondayTrade_1 = True

TuesdayTrade_1 = False

WednesdayTrade_1 = True

星期一鎖倉,下一天開倉就是星期三



----------------------------------------------------------------

3. 新聞過濾


在新聞時間前分鐘=開/鎖/無

在新聞時間後分鐘=開/鎖/無

LowNews = True / Falue

Before a low news (Min.) = 240

After a low news (Min.) = 240

MediumNews = True / Falue

Before a low news (Min.) = 240

After a low news (Min.) = 240

HighNews = True / Falue

Before a low news (Min.) = 240

After a low news (Min.) = 240


----------------------------------------------------------------

4. 保險機制(鎖倉):


鎖倉: 當價格波動率超過參數,就會觸發掛單而鎖倉


統計每日的00:00至05:00的平均波動率去設定哪個價位鎖倉,等待下一個時間交易


統計過去指定的時間範圍來得到平均價格波動率,從而得出哪個價位鎖倉.


事例4.1: 


EA設置:

時間範圍: 00:00-08:00

星期範圍: 1,3,5,7

日數範圍: 6

價格波動率限制:200%


公式:

日數範圍是6,例如星期一為第1天,星期六為第6天,而這6天只統計星期一,星期三和星期五,取3天價格.


第1天的星期一 = 1246(低位)-1250(高位)=4 

第2天的星期三 = 1254(低位)-1258(高位)=4

第3天的星期五 = 1237(低位)-1239(高位)=2

3天平均價格波動率 = (4+4+2)/3=3.33


價格波動率限制

3.33*200%=6.66

如果超過6.66,就鎖倉,等到下一天才解倉.


有2個情況:

無條件開倉,就是說第一單是buy1246,鎖倉價是1246-6.66.

技術分析低位開倉,就是說第一單是buy1240,鎖倉價是1240-6.66.鎖倉價是buy order以當日的第1單的價格-價格波動率限制


, sell order以當日的第1單的價格+價格波動率限制


----------------------------------------------------------------

事例5.1

buy/sell signal_open_A_1_value

buy/sell signal_pause_A_1_value

說明圖在圖2.png, 3.png



--------------------

事例5.2

說明:進場信號和鎖倉信號

BOL_A_1 = True 開啟BOL的參數

Bands Period_A_1 = 50 參數來至MT5的BOL, 請看圖3.png

Bands Shift_A_1 = 0 參數來至MT5的BOL, 請看圖3.png

Bands Deviations_A_1 = 2.0 參數來至MT5的BOL, 請看圖3.png

MinimumBandSize_A_1 = 100 通道最少值


Buy signal_open_A_1 = True

Buy signal_open_A_1_value: >=0 當升穿這條線買入,請看圖4.png

Buy signal_pause_A_1 = Falue

Buy signal_pause_A_1_value:


Sell signal_open_A_1 = Falue

Sell signal_open_A_1_value:

Sell signal_pause_A_1 = Falue

Sell signal_pause_A_1_value:


BOL_B_1 = True

Bands Period_B_1 = 10

Bands Shift_B_1 = 0

Bands Deviations_B_1 = 2.0

MinimumBandSize_B_1 = 100


Buy signal_open_B_1 = Falue

Buy signal_open_B_1_value:

Buy signal_pause_B_1 = True

Buy signal_pause_B_1_value: <=0 當跌穿這條線鎖倉,請看圖4.png


Sell signal_open_B_1 = Falue

Sell signal_open_B_1_value:

Sell signal_pause_B_1 = Falue

Sell signal_pause_B_1_value:


在相同區間鎖倉上限 = 1 請看圖5.png

鎖倉與解倉的最少距離 = 100


Zigzag_reopen_1 True / False 請看圖5.png

InpDepth_1 12

InpDeviation_1 5

InpBackstep_1 3


附加的文件:

PNG
1.png
28.2 Kb
PNG
2.png
31.7 Kb
PNG
3.png
48.5 Kb
PNG
4.png
531.0 Kb
PNG
5.png
420.7 Kb
PNG
6.png
21.4 Kb
TXT
2nEA47.txt
2.1 Kb

反馈

1
开发者 1
2020.10.15
等级
0
项目
0
0%
仲裁
0
逾期
0
空闲

项目信息

预算
30+ USD
开发人员
27 USD
截止日期
 1  3 天

客户

所下订单22
仲裁计数7