【RcvPop3Mail】斉藤学氏のメルマガ「よく当たるFX為替レート予想」自動化EAの改善
メール受信時、既にT/P価格を突破している場合はエントリーしない様に修正します。
EAソース(Manabu.mq4)の_EntryProcess()関数を書き換えます。
bool _EntryProcess(int MailIndex)
.
.
.
if(Debug){
temp = "currency:" + sCurrecy;
if(bBuy)
temp = temp + " Buy";
if(bSell)
temp = temp + " Sell";
temp = temp + " Limit:" + dbLimitPrice + " Stop:" + dbStopPrice + " Comment:" + comm;
Print(temp);
}
//ここから↓
RefreshRates();
double price;
bool bSkipEntry = false;
if(bBuy){
price = MarketInfo(symbol, MODE_BID);
if(price >= dbLimitPrice)
bSkipEntry = true;
}else{
price = MarketInfo(symbol, MODE_ASK);
if(price <= dbLimitPrice)
bSkipEntry = true;
}
if(bSkipEntry){
if(Debug)
Print(sCurrecy, " Order Skip.");
return(false);
}
//ここまでを追加↑
for(int retry = 0; retry < 10; retry++){
if(bBuy){
if(!_OpenBuy(sCurrecy, dbLimitPrice, dbStopPrice, comm))
break;
}else{
if(!_OpenSell(sCurrecy, dbLimitPrice, dbStopPrice, comm))
break;
}
Sleep(1000);
}
sCurrecy = "";
.
.
.
面倒くさい方はこれをダウンロードして差し替えてください。
バージョンは2013.8.26.1です。
自動化の方法はこちらの記事で紹介しています。
