매우 간단한 EA를 만드는 데 도움이 필요합니다. - 페이지 3 1234567 새 코멘트 Dua Yong Rew 2008.12.02 03:52 #21 //+------------------------------------------------------------------+ //| Stepper.mq4 | //| doshur | //| www.doshur.com | //+------------------------------------------------------------------+ #property copyright "doshur" #property link "www.doshur.com" extern int TakeProfit = 5; extern int Range = 20; extern int Risk = 2; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { return(0); } int deinit() { return(0); } int start() { //---- static bool ToTrade = false; static bool FirstTrade = true; double PrevLow = iLow(Symbol(), 0, 1); double PrevHigh = iHigh(Symbol(), 0, 1); double PrevRange = (PrevHigh - PrevLow) / Point; if(NewBar()) { if(FirstTrade == false) { if(PrevRange >= Range) ToTrade = true; else ToTrade = false; } else { FirstTrade = false; } } if(ToTrade) { if(COT(1) < 1) { if(Ask > PrevHigh) OrderSend(Symbol(), OP_BUY, MM(PrevRange, Risk), Ask, 3, PrevLow, Ask + TakeProfit * Point, "Stepper - BUY", 57390, 0, Blue); } if(COT(2) < 1) { if(Bid < PrevLow) OrderSend(Symbol(), OP_SELL, MM(PrevRange, Risk), Bid, 3, PrevHigh, Bid - TakeProfit * Point, "Stepper - SELL", 57391, 0, Red); } } //---- return(0); } //+------------------------------------------------------------------+ //---- Check Is New Bar bool NewBar() { static datetime PrevBar; if(PrevBar < Time[0]) { PrevBar = Time[0]; return(true); } else { return(false); } return(false); } //---- Check Open Trades int COT(int BS) { int Buys = 0, Sells = 0; for(int cnt_COT = 0; cnt_COT < OrdersTotal(); cnt_COT++) { OrderSelect(cnt_COT, SELECT_BY_POS, MODE_TRADES); if(OrderType() == OP_BUY && OrderSymbol() == Symbol()) Buys++; if(OrderType() == OP_SELL && OrderSymbol() == Symbol()) Sells++; } if(BS == 1) return(Buys); if(BS == 2) return(Sells); } //---- Money Management double MM(int SL, int RK) { double rLots = NormalizeDouble(AccountBalance() / 1000 * RK / SL, 1); // Risk ?% of balance if(rLots < 0.1) rLots = 0.1; return(rLots); } 문제 및 기타 문제를 극복하기 위해 첫 번째 실행을 구현했습니다. 코드를 테스트하지 않았습니다 Pls는 다른 수정안을 테스트하고 나열합니다. Need help creating a MQL4 Learning [Archive!] I will write [삭제] 2008.12.02 06:27 #22 is there away where we can modify the stop loss to so 15 or 20 instead of the other end of the candle? Dua Yong Rew 2008.12.02 07:38 #23 crazfoto 2008.12.02 08:27 양초의 다른 쪽 끝 대신 손절매를 15 또는 20으로 수정할 수 있는 곳이 있습니까? 네. 것이 가능하다. [삭제] 2008.12.02 14:41 #24 2시간 평균인가요? 또는 30min의 다른 버전? 2시간 평균이면 어제 거래를 실행하지 않았습니다. Dua Yong Rew 2008.12.02 16:21 #25 crazfoto : 2시간 평균인가요? 또는 30min의 다른 버전? 2시간 평균이면 어제 거래를 실행하지 않았습니다. 내 코드를 의미합니까? 요청하신 대로 30분 동안 구현되었습니다. [삭제] 2008.12.02 16:27 #26 오. 내 잘못이야. 지금 테스트하겠습니다. 도와주셔서 정말 감사합니다. 나는 4시간 차트에서 위트를 연주했다. 4시간 차트에서 스톱을 15 또는 20핍으로 변경하면 결과가 좋을 것이라고 생각합니다. 그리고 내가 무엇을 하던지. [삭제] 2008.12.02 16:29 #27 오프라인 2시간 차트에서 작동합니까? 많은 사람들이 오프라인 차트에서 EA를 사용하는 데 문제가 있는 것을 봅니다. [삭제] 2008.12.02 16:49 #28 1시간 차트에서만 작동합니다. [삭제] 2008.12.02 17:16 #29 좋아요. 30분 차트에서는 작동하지만 결제할 때마다 계속 주문을 입력합니다. 따라서 새 주문을 입력하기 전에 30분 촛불이 형성되기를 기다리지 않습니다. Dua Yong Rew 2008.12.02 17:40 #30 이런. 일단 입력하면 비활성화하는 것을 잊었습니다. 내가 코드를 수정하자 1234567 새 코멘트 트레이딩 기회를 놓치고 있어요: 무료 트레이딩 앱 복사용 8,000 이상의 시그널 금융 시장 개척을 위한 경제 뉴스 등록 로그인 공백없는 라틴 문자 비밀번호가 이 이메일로 전송될 것입니다 오류 발생됨 Google으로 로그인 웹사이트 정책 및 이용약관에 동의합니다. 계정이 없으시면, 가입하십시오 MQL5.com 웹사이트에 로그인을 하기 위해 쿠키를 허용하십시오. 브라우저에서 필요한 설정을 활성화하시지 않으면, 로그인할 수 없습니다. 사용자명/비밀번호를 잊으셨습니까? Google으로 로그인
//+------------------------------------------------------------------+
//| Stepper.mq4 |
//| doshur |
//| www.doshur.com |
//+------------------------------------------------------------------+
#property copyright "doshur"
#property link "www.doshur.com"
extern int TakeProfit = 5;
extern int Range = 20;
extern int Risk = 2;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
int deinit()
{
return(0);
}
int start()
{
//----
static bool ToTrade = false;
static bool FirstTrade = true;
double PrevLow = iLow(Symbol(), 0, 1);
double PrevHigh = iHigh(Symbol(), 0, 1);
double PrevRange = (PrevHigh - PrevLow) / Point;
if(NewBar())
{
if(FirstTrade == false)
{
if(PrevRange >= Range)
ToTrade = true;
else
ToTrade = false;
}
else
{
FirstTrade = false;
}
}
if(ToTrade)
{
if(COT(1) < 1)
{
if(Ask > PrevHigh)
OrderSend(Symbol(), OP_BUY, MM(PrevRange, Risk), Ask, 3, PrevLow, Ask + TakeProfit * Point, "Stepper - BUY", 57390, 0, Blue);
}
if(COT(2) < 1)
{
if(Bid < PrevLow)
OrderSend(Symbol(), OP_SELL, MM(PrevRange, Risk), Bid, 3, PrevHigh, Bid - TakeProfit * Point, "Stepper - SELL", 57391, 0, Red);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
//---- Check Is New Bar
bool NewBar()
{
static datetime PrevBar;
if(PrevBar < Time[0])
{
PrevBar = Time[0];
return(true);
}
else
{
return(false);
}
return(false);
}
//---- Check Open Trades
int COT(int BS)
{
int Buys = 0, Sells = 0;
for(int cnt_COT = 0; cnt_COT < OrdersTotal(); cnt_COT++)
{
OrderSelect(cnt_COT, SELECT_BY_POS, MODE_TRADES);
if(OrderType() == OP_BUY && OrderSymbol() == Symbol()) Buys++;
if(OrderType() == OP_SELL && OrderSymbol() == Symbol()) Sells++;
}
if(BS == 1) return(Buys);
if(BS == 2) return(Sells);
}
//---- Money Management
double MM(int SL, int RK)
{
double rLots = NormalizeDouble(AccountBalance() / 1000 * RK / SL, 1); // Risk ?% of balance
if(rLots < 0.1) rLots = 0.1;
return(rLots);
}
문제 및 기타 문제를 극복하기 위해 첫 번째 실행을 구현했습니다.
코드를 테스트하지 않았습니다
Pls는 다른 수정안을 테스트하고 나열합니다.
is there away where we can modify the stop loss to so 15 or 20 instead of the other end of the candle?
crazfoto 2008.12.02 08:27 양초의 다른 쪽 끝 대신 손절매를 15 또는 20으로 수정할 수 있는 곳이 있습니까?
네. 것이 가능하다.
2시간 평균인가요? 또는 30min의 다른 버전?
2시간 평균이면 어제 거래를 실행하지 않았습니다.
2시간 평균인가요? 또는 30min의 다른 버전?
2시간 평균이면 어제 거래를 실행하지 않았습니다.
내 코드를 의미합니까?
요청하신 대로 30분 동안 구현되었습니다.
오. 내 잘못이야. 지금 테스트하겠습니다.
도와주셔서 정말 감사합니다. 나는 4시간 차트에서 위트를 연주했다. 4시간 차트에서 스톱을 15 또는 20핍으로 변경하면 결과가 좋을 것이라고 생각합니다. 그리고 내가 무엇을 하던지.
이런.
일단 입력하면 비활성화하는 것을 잊었습니다.
내가 코드를 수정하자