☞ Winner M15는 러시아에서 개발된 Winner H4를 15분봉에 적용할 수 있도록 Customize하여 Fractals신호로 매매하는 Expert Advisor 로서 Trailing & BreakEven 등을 추가하였다. 시장이 크게 움직일 때, 유용한 EA로, Fractal이론자체가 일정기간들의 차트움직임이 반복된다는 가정에 있으므로, 60개바의 고가-저가의 변화율의 결과들의 분포함을 배열로 저장(확률분포함수) 하였으며, Filter Depth값을 최적화하는 것이 관건(반복되는 기간으로 전제되는 봉의 개수)으로, 값을 증가시킬수록 수익성이 나아진다는 포럼에서의 경험담 글들이 있다.
//********************************************************************
//| Winner M15 V0.2 |
//| Copyright @ |
//********************************************************************
//********************************************************************
//| Fractals신호로 매매하는 Expert Advisor |
//| 사용통화 : AUDUSD,EURUSD,GBPUSD,USDCAD,USDCHF |
//| Time Frame : M15 |
//********************************************************************
//********************************************************************
//| Version History |
//********************************************************************
/*
Version 0.1
- FixLot 및 MoneyManagement 추가
- 화면표시정보 추가
Version 0.2
- Trailing Stop & BreakEven 기능 추가
*/
//********************************************************************
//| 일반외생변수 및 기타 내생변수 설정 |
//********************************************************************
// Money Management 사용시 MoneyManagement = TRUE && FixLot = 0.0, RiskPercent>0 으로 사용가능
extern bool MoneyManagement = FALSE;
extern int RiskPercent = 10;
extern double FixLot = 0.1;
extern int FilterDepth = 60;
extern bool AutoMagic = TRUE; // 통화별 자동 매직넘버 부여
extern int Magic = 39785124;
extern int Slippage = 3;
extern bool ECN = TRUE;
extern string OrderCmnt = "Y.S.Park Winner M15 V0.2";
int prevtime = 0;
double FracStop;
double MinStop = 3.0;
extern double StopOutBalance = 500; // 강제청산 기준 잔고
extern double TrailingStop = 13.0; // 트레일링 설정시 > 0
extern double BreakEven = 10.0; // Break Even 설정시 > 0
extern double BreakPoint = 2.0; // Break Even 설정시 손절치(본전 + 손절치)
double maxLot,LotSizes, mypoint; // MarketInfo 정보를 받는 변수(Double)
double minlot,LotStep,stopout,reqmargin,equity; // MarketInfo 정보를 받는 변수(Double)
int spread, mydigit,stoplevel,freeze, leverage; // MarketInfo 정보를 받는 변수(Integer)
string servername,StartDay,mytime; // MarketInfo 정보를 받는 변수(String)
//********************************************************************
//| Initialization |
//********************************************************************
void init()
{
StartDay = TimeToStr(TimeCurrent(),TIME_DATE);
mypoint = MarketInfo(Symbol(),MODE_POINT);
if (Digits == 5 || Digits == 3) {
mypoint = 10.0 * mypoint;
Slippage = 10 * Slippage;
}
}
void start() {
double data[60]; //data
double Signal;
double MarketStop;
bool In_Trade;
double Lots;
double Fractal;
double MarketTicket;
//***********************************************
// 통화별 매직넘버 가져오기
getmagic();
//***********************************************
// Trailing Stop & BreakEven 가져오기
if(TrailingStop>0) MoveTrailingStop();
if(BreakEven>0) MoveBreakEven();
//***********************************************
// StopOut Balance도달시 강제청산함수 가져오기
StopOutClose();
//***********************************************
// MarketInfo 정보를 받는 변수 설정
mydigit = MarketInfo(Symbol(), MODE_DIGITS);
spread = MarketInfo(Symbol(),MODE_SPREAD);
stoplevel = MarketInfo(Symbol(), MODE_STOPLEVEL);
freeze = MarketInfo(Symbol(), MODE_FREEZELEVEL);
maxLot = MarketInfo(Symbol(), MODE_MAXLOT);
minlot = MarketInfo(Symbol(), MODE_MINLOT);
LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
LotSizes = MarketInfo(Symbol(), MODE_LOTSIZE);
//********************************************************************
// ***** 조건충족시 Order Close / Order Modify ****
if (prevtime != Time[0])
{
if (ArrayCopy(data, Close, 1, 1, FilterDepth) == FilterDepth)
{
Signal = W15(data);
// signals:
// + if previous fractal low, looking to Buy on appearance of next fractal low
// - if previous fractal high, looking to Sell on appearance of next fractal high
MarketStop = MathMax(MarketInfo(Symbol(), MODE_STOPLEVEL) * Point, MinStop * mypoint);
In_Trade = FALSE;
for (int pos = OrdersTotal() - 1; pos >= 0; pos--)
{
if (OrderSelect(pos, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() != Symbol() || OrderMagicNumber() != Magic) continue;
RefreshRates();
if (OrderType() == OP_BUY)
{
if (OrderProfit() > 0.0 && Signal > 0.0) // Signal > 0.0
{
if (!(OrderClose(OrderTicket(), OrderLots(), f0_0(Bid), Slippage, Blue))) return;
continue;
}
if (OrderStopLoss() == 0.0) if (!(OrderModify(OrderTicket(), OrderOpenPrice(), f0_0(MathMin(FracStop, Bid - MarketStop)), 0, 0, Blue))) return;
}
if (OrderType() == OP_SELL)
{
if (OrderProfit() > 0.0 && Signal < 0.0) // Signal < 0.0
{
if (!(OrderClose(OrderTicket(), OrderLots(), f0_0(Ask), Slippage, Red))) return;
continue;
}
if (OrderStopLoss() == 0.0) if (!(OrderModify(OrderTicket(), OrderOpenPrice(), f0_0(MathMax(FracStop, Ask + MarketStop)), 0, 0, Red))) return;
}
In_Trade = TRUE;
}
}
//********************************************************************
// ***** 조건충족시 Order Send ****
prevtime = Time[0];
if (In_Trade == FALSE)
{
if(FixLot==0 && MoneyManagement){
Lots = MathMax(MarketInfo(Symbol(), MODE_MINLOT), AccountFreeMargin() * RiskPercent / MarketInfo(Symbol(), MODE_LOTSIZE));
Lots = NormalizeDouble(MathMin(Lots, MarketInfo(Symbol(), MODE_MAXLOT)), MathLog(MarketInfo(Symbol(), MODE_LOTSTEP)) / MathLog(0.1));
}
else
{
Lots = FixLot;
}
RefreshRates();
Fractal = iFractals(Symbol(), 0, MODE_LOWER, 3); // 3 bars ago = confirmed
if (Fractal != 0.0 && Signal > FilterDepth) //Signal > 0.0
{
FracStop = Fractal;
if (ECN)
{
MarketTicket = OrderSend(Symbol(), OP_BUY, Lots, f0_0(Ask), Slippage, 0, 0, OrderCmnt, Magic, 0, Blue);
if (OrderSelect(MarketTicket, SELECT_BY_TICKET)) if (!OrderModify(OrderTicket(), OrderOpenPrice(), f0_0(MathMin(FracStop, Bid - MarketStop)), 0, 0, Blue)) prevtime = FALSE;
}
else MarketTicket = OrderSend(Symbol(), OP_BUY, Lots, f0_0(Ask), Slippage, f0_0(MathMin(FracStop, Bid - MarketStop)), 0, OrderCmnt, Magic, 0, Blue);
if (MarketTicket == -1.0) prevtime = FALSE;
}
Fractal = iFractals(Symbol(), 0, MODE_UPPER, 3);
if (Fractal != 0.0 && Signal < -FilterDepth) //Signal < 0.0
{
FracStop = Fractal + Ask - Bid;
if (ECN)
{
MarketTicket = OrderSend(Symbol(), OP_SELL, Lots, f0_0(Bid), Slippage, 0, 0, OrderCmnt, Magic, 0, Red);
if (OrderSelect(MarketTicket, SELECT_BY_TICKET)) if (!OrderModify(OrderTicket(), OrderOpenPrice(), f0_0(MathMax(FracStop, Ask + MarketStop)), 0, 0, Red)) prevtime = FALSE;
}
else MarketTicket = OrderSend(Symbol(), OP_SELL, Lots, f0_0(Bid), Slippage, f0_0(MathMax(FracStop, Ask + MarketStop)), 0, OrderCmnt, Magic, 0, Red);
if (MarketTicket == -1.0) prevtime = FALSE;
}
}
}
}
//********************************************************************
//| 화면표시정보 |
//********************************************************************
// 화면표시 변수 설정
string ScreenStr;
ScreenStr = StringConcatenate("Server : ",AccountServer()," Start Date_",StartDay," , My Time_",TimeToStr(TimeCurrent(),TIME_SECONDS)," 평가잔액 = ",AccountEquity()," Leverage: ",AccountLeverage(),":1, 1Lot당 증거금_$",MarketInfo(Symbol(), MODE_MARGINREQUIRED))+"\n";
ScreenStr = ScreenStr + StringConcatenate("StopLevel : ",stoplevel," , Freeze Level : ",freeze," , StopOut : ",AccountStopoutLevel(),"%, Spread_",spread," Fractal Signal(+Buy,-Sell) : ",NormalizeDouble(Signal,2))+"\n";
ScreenStr = ScreenStr + StringConcatenate("New Profits : ",Profit(Magic),", New Orders : ",TotalBuyOrders(Magic)+TotalSellOrders(Magic),"건 = Buy ",TotalBuyOrders(Magic),"건 / Sell",TotalSellOrders(Magic),"건") + "\n";
ScreenStr = ScreenStr +"===========================================================================================" + "\n";
ScreenStr = ScreenStr + StringConcatenate("Total Profits : $",HBProfit(Magic)+HSProfit(Magic),", Buy : $",HBProfit(Magic),", Sell : $",HSProfit(Magic),", Total Orders : ",HBuyOrders(Magic)+HSellOrders(Magic),"건 = Total Buy ",HBuyOrders(Magic),"건 / Total Sell",HSellOrders(Magic),"건")+ "\n";
Comment(ScreenStr);
}
//********************************************************************
//| 통화별 매직넘버 설정 함수 |
//********************************************************************
int getmagic() {
if( AutoMagic == TRUE ) {
if(Symbol() == "GBPUSDm" || Symbol() == "GBPUSD") Magic = 1098746;
if(Symbol() == "AUDUSDm" || Symbol() == "AUDUSD") Magic = 2098746;
if(Symbol() == "EURUSDm" || Symbol() == "EURUSD") Magic = 3098746;
if(Symbol() == "USDCADm" || Symbol() == "USDCAD") Magic = 4098746;
if(Symbol() == "USDCHFm" || Symbol() == "USDCHF") Magic = 5098746;
if(Symbol() == "EURGBPm" || Symbol() == "EURGBP") Magic = 6098746;
if(Symbol() == "USDJPYm" || Symbol() == "USDJPY") Magic = 7098746;
}
return(Magic);
}
//********************************************************************
//| NormalizeDouble Customize 함수 |
//********************************************************************
double f0_0(double ad_0) {
return (NormalizeDouble(ad_0, Digits));
}
//********************************************************************
//| Stop Out조건발생시 전체 일괄 청산 함수 |
//********************************************************************
void StopOutClose() { // 0
bool CloseAllOrders = false;
if(AccountFreeMargin() < StopOutBalance || AccountBalance() < StopOutBalance) CloseAllOrders = true;
else CloseAllOrders = false;
if(CloseAllOrders) { // 15
int totalord = OrdersTotal();
for(int jk=totalord-1;jk >= 0;jk--) { // 16
OrderSelect(jk, SELECT_BY_POS, MODE_TRADES);
int types = OrderType();
bool resultall = false;
RefreshRates();
switch(types) { //switch
case OP_BUY : resultall = OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),5,Red);
break;
case OP_SELL : resultall = OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),5, Blue);
} //switch
if(resultall == false) { // 17
Print("Order ", OrderTicket(), " failed to close. Error:", GetLastError() );
} // 17
} // 16
} // 15
} // 0
//+------------------------------------------------------------------+
//| Profit Calculate Function(수익 계산 함수) |
//+------------------------------------------------------------------+
double Profit(int Magics) { // 0
double Prof=0;
for (int k=0; k < OrdersTotal(); k++)
{ // 1
if (OrderSelect(k, SELECT_BY_POS, MODE_TRADES))
{ // 2
if (OrderSymbol()==Symbol() && OrderMagicNumber()==Magics)
{ // 3
Prof = Prof + OrderProfit();
} // 3
} // 2
} // 1
return(Prof);
} // 0
//+------------------------------------------------------------------+
//| Total Buy order Calculate Function(총매수오더수 계산 함수) |
//+------------------------------------------------------------------+
int TotalBuyOrders(int Magics) { // 0
int cnt=0;
for (int i=0; i < OrdersTotal(); i++)
{ // 1
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{ // 2
if (OrderMagicNumber()==Magics && OrderType()==OP_BUY )
{ // 3
cnt++;
} // 3
} // 2
} // 1
return(cnt);
} // 0
//+------------------------------------------------------------------+
//| Total Sell order Calculate Function(총매도오더수 계산 함수) |
//+------------------------------------------------------------------+
int TotalSellOrders(int Magics) { // 0
int cnt=0;
for (int i=0; i < OrdersTotal(); i++)
{ // 1
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{ // 2
if (OrderMagicNumber()==Magics && OrderType()==OP_SELL)
{ // 3
cnt++;
} // 3
} // 2
} // 1
return(cnt);
} // 0
//+------------------------------------------------------------------+
//| 총매수수익 계산 함수(과거치 포함) |
//+------------------------------------------------------------------+
double HBProfit(int Magics) { // 0
double Prof=0;
for (int k=0; k < OrdersHistoryTotal(); k++)
{ // 1
if (OrderSelect(k, SELECT_BY_POS, MODE_HISTORY))
{ // 2
if (OrderSymbol()==Symbol() && OrderMagicNumber()==Magics && OrderType()==OP_BUY)
{ // 3
Prof = Prof + OrderProfit();
} // 3
} // 2
} // 1
return(Prof);
} // 0
//+------------------------------------------------------------------+
//| 총매도수익 계산 함수(과거치 포함) |
//+------------------------------------------------------------------+
double HSProfit(int Magics) { // 0
double Prof=0;
for (int k=0; k < OrdersHistoryTotal(); k++)
{ // 1
if (OrderSelect(k, SELECT_BY_POS, MODE_HISTORY))
{ // 2
if (OrderSymbol()==Symbol() && OrderMagicNumber()==Magics && OrderType()==OP_SELL)
{ // 3
Prof = Prof + OrderProfit();
} // 3
} // 2
} // 1
return(Prof);
} // 0
//+------------------------------------------------------------------+
//| 총Buy오더수 계산 함수(과거치 포함) |
//+------------------------------------------------------------------+
int HBuyOrders(int Magics) { // 0
int cnt=0;
for (int i=0; i < OrdersHistoryTotal(); i++)
{ // 1
if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))
{ // 2
if (OrderMagicNumber()==Magics && OrderType()==OP_BUY)
{ // 3
cnt++;
} // 3
} // 2
} // 1
return(cnt);
} // 0
//+------------------------------------------------------------------+
//| 총Sell오더수 계산 함수(과거치 포함) |
//+------------------------------------------------------------------+
int HSellOrders(int Magics) { // 0
int cnt=0;
for (int i=0; i < OrdersHistoryTotal(); i++)
{ // 1
if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))
{ // 2
if (OrderMagicNumber()==Magics && OrderType()==OP_SELL)
{ // 3
cnt++;
} // 3
} // 2
} // 1
return(cnt);
} // 0
//+------------------------------------------------------------------+
//| Trailing Stop |
//+------------------------------------------------------------------+
void MoveTrailingStop()
{
int ct,totl=OrdersTotal();
RefreshRates();
if (OrdersTotal() > 0) {
for(ct=0;ct<totl;ct++)
{
OrderSelect(ct,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if( TrailingStop>0 && Bid>NormalizeDouble(OrderOpenPrice()+TrailingStop*mypoint*Point,Digits) )
{
if((NormalizeDouble(OrderStopLoss(),Digits)<NormalizeDouble(Bid-mypoint*TrailingStop*Point,Digits))||(OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-mypoint*TrailingStop*Point,Digits),OrderTakeProfit(),0,Blue);
return(0);
}
}
}
if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if( TrailingStop>0 && Ask<NormalizeDouble(OrderOpenPrice()-TrailingStop*mypoint*Point,Digits) )
{
if((NormalizeDouble(OrderStopLoss(),Digits)>(NormalizeDouble(Ask+(mypoint*TrailingStop*Point),Digits)))||(OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Ask+(mypoint*TrailingStop*Point),Digits),OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
//+------------------------------------------------------------------+
//| Break Even Strategy |
//+------------------------------------------------------------------+
void MoveBreakEven()
{
int cnt,total=OrdersTotal();
RefreshRates();
if (OrdersTotal() > 0) {
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if( OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==Magic )
{
if(OrderType()==OP_BUY)
{
if(BreakEven>0)
{
if(NormalizeDouble((Bid-OrderOpenPrice()),Digits) > BreakEven*mypoint*Point)
{
if(NormalizeDouble((OrderStopLoss()-OrderOpenPrice()),Digits) < 0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()+BreakPoint*mypoint*Point,Digits),OrderTakeProfit(),0,Blue);
return(0);
}
}
}
}
else
{
if(BreakEven>0)
{
if(NormalizeDouble((OrderOpenPrice()-Ask),Digits) > BreakEven*mypoint*Point)
{
if(NormalizeDouble((OrderOpenPrice()-OrderStopLoss()),Digits) < 0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()-BreakPoint*mypoint*Point,Digits),OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
}
//********************************************************************
//| Fractal Range 계산 함수 |
//********************************************************************
double W15(double a0[])
{
int ar1[] = {
-75, -4, 3, -2, -6, 1, 6, 8, 6, 7,
-2, 2, 1, 9, 1, 2, 2, 3, 4, -5,
-5, 3, -2, -1, -1, -2, 6, 5, 4, 2,
6, -1, 2, 4, 3, 2, 1, -1, 2, 0,
-1, -1, 1, -3, 1, 7, -1, 1, 2, 4,
-2, 5, -4, -3, 1, -4, -3, 2, -3, 7,
10, -3, 6, 5, 4, 1, 26, 11, -1, -8,
1, 4, 1, -5, -3, -7, 0, -5, 3, -6,
-1, 0, 4, 0, -3, 6, -2, -1, -10, -10,
-3, -4, 5, -4, -1, -1, -4, -7, 0, -2,
46, 4, 4, -2, -1, 6, 1, -1, -1, -1,
1, -5, 3, -1, 3, -3, 2, -4, 11, 6,
86, 16, 13, 21, 11, 9, 5, -4, 12, -1,
-1, 12, -6, 3, 0, -9, -8, -3, -3, 1,
8, -2, -2, -4, 10, -6, -7, 8, -11, -1,
-2, -5, -3, -7, -11, -13, 0, 1, -10, -15,
-17, -1, -1, -2, 1, 0, -1, 0, 1, 0,
-4, 0, 1, 1, -2, 2, -4, 8, 1, 1,
48, 2, 8, 18, 13, 3, 9, 14, 4, 6,
14, 4, -2, -7, 10, -4, 6, 4, -3, -3,
3, -3, 2, 10, -5, -5, -2, -3, -4, 1,
-15, -2, -7, -10, -17, -18, -3, -10, -10, -11,
-89, -3, -4, 5, -5, 0, 2, -1, 4, 1,
4, 11, 1, 1, -4, 3, -1, 3, 7, 0,
-13, 0, 3, 4, -6, -1, -7, -1, 2, -6,
14, -5, -3, 9, -1, -7, 9, -4, 9, -6,
7, 8, -2, 0, 7, 7, -1, -2, -16, -14,
-8, -10, -4, -5, -12, -11, -13, -2, -3, -9,
-56, 0, 0, -1, 0, -6, -1, 2, 4, 4,
1, 9, 5, 4, -2, 5, 3, -1, -3, 7,
-17, -6, -8, -4, -6, -11, 3, -6, -6, 4,
5, -5, -2, 0, -3, 5, 0, -5, -9, -3,
2, -3, -3, 4, 2, -2, -5, -7, 0, -3,
-5, 4, -4, -4, 5, -6, 5, -1, 3, 1,
4, 6, -3, 2, 0, -1, 7, -3, -1, 4,
1, -2, -1, -7, 3, 1, -3, 0, -8, 5,
-9, -7, -8, -6, 4, -7, -4, 11, 2, -10,
-11, 6, 5, -3, -2, -7, -5, -4, -6, 5,
-1, 2, 13, 6, -8, -6, 3, -2, 1, 4,
-7, 0, 9, -5, 0, 8, 0, 2, -12, 1,
13, 5, -2, -4, -2, 4, 6, -2, 1, -5,
-8, 5, -2, 2, -3, 4, -2, 4, 0, -5,
-3, 3, 3, 8, -2, -1, -5, -7, 0, -8,
-1, 7, 7, -2, 1, -8, -12, -1, -7, 3,
-2, 3, -9, 9, 7, -2, -13, 5, -4, 3,
3, -7, 4, -7, 2, 16, 0, -7, -2, 6,
16, -6, -4, 0, 4, 5, 3, -4, 3, 1,
4, -1, 2, -1, -3, -3, -2, 0, -1, 0,
-9, -5, -4, 4, 2, -3, -4, -7, -1, -7,
1, -4, 3, 1, 6, 8, -2, -3, 7, 5,
-15, -4, -9, -1, -11, 9, 0, -2, 6, 16,
0, 20, 9, -4, -1, 7, -4, 0, 6, 0,
-8, 3, 8, -7, 6, -2, -6, -11, 4, 4,
-2, 1, -2, 3, -1, -1, 3, -1, 1, -8,
-3, -7, -2, 0, 5, -1, 1, -6, -6, 6,
-1, -4, -11, -2, -1, 1, 2, 0, 1, -12,
6, -7, -9, 6, -1, 5, 4, -6, 2, 0,
-5, 18, -5, 6, -3, -2, -4, -2, -4, 1,
13, -2, -6, 0, 0, 3, -3, 3, -6, 0,
-1, 2, 3, 4, 1, -3, -2, 4, -1, -3,
2, -7, 2, -1, -2, -7, -4, -2, -8, 6,
8, -8, -15, -1, -8, 0, 0, 6, -1, 0,
8, 3, 1, 2, 0, -4, 2, 6, 3, 2,
-6, -3, -4, 5, -1, -3, 9, -3, -9, 1,
-1, 7, 6, -2, -1, -3, 1, 6, 0, -1,
-3, 5, -2, 2, 2, 2, 0, 5, 4, 2,
-7, -12, -6, 2, 3, 5, 1, 0, 3, -6,
-4, 4, -8, 7, 5, -7, -8, -7, -8, 3,
2, 2, -1, 3, -3, 11, 12, 0, -4, -1,
-3, 7, -7, 3, -6, 13, -6, -14, -4, -4,
0, 6, 2, 4, -7, -6, -5, 9, 9, -5,
-6, 4, 1, 7, -2, 9, -2, 5, -6, -2,
11, 3, 7, -6, -4, -9, -1, -8, -4, -6,
0, -5, 3, -10, 8, 1, 8, 3, 1, -11,
-3, 1, -3, -1, -4, 12, 2, -9, 3, -1,
-3, 4, 1, -11, 11, 0, 1, -5, -8, -3,
5, -1, -1, -2, 5, -7, 3, -3, 4, -1,
0, 7, -3, -5, -5, -1, 6, -4, 2, 2,
-2, 8, 0, -3, -6, 1, -4, 4, 2, 0,
1, 2, 1, -4, 0, -2, -10, 5, 0, 5,
-5, -8, -2, 4, 8, 1, -2, 11, 4, -12,
2, 0, 11, 3, -2, 0, -6, -8, -3, 3,
2, -3, 1, -2, 0, -1, -1, 0, 1, 1,
6, 0, -7, -11, -5, -4, -3, 8, -3, -4,
13, 6, 3, 6, -2, 1, -7, -1, -3, 2,
-7, 1, 0, 0, 5, -4, -1, 9, 12, -8,
7, -3, 2, 2, 3, 3, 0, -7, 1, -6,
-4, 3, 2, -3, -9, -4, -14, -3, 9, 0,
-8, 2, 1, -12, -6, 2, 3, 3, -6, -7,
-2, -1, 0, -3, -6, 8, -6, 3, -3, 0,
-6, 1, 7, -5, 10, -4, 2, 2, 3, -10,
-1, 10, 2, -2, 3, -3, 0, -2, 1, 2,
-4, 6, 6, -1, 8, -2, 6, -6, -3, 16,
-6, -2, -5, -5, -6, 6, -6, 0, -3, -3,
0, -3, -2, -6, -10, -5, 0, -4, 4, -3,
3, -5, 2, 4, -1, 3, -2, 3, 5, 4,
10, -4, -3, -6, 2, 11, 1, -5, 10, 0,
5, -2, 4, 0, 2, 0, -9, 9, 0, -12,
-5, -5, 1, -5, -7, -13, -10, -12, 2, -2,
2, 1, 8, 11, -3, 4, 6, 3, -2, -3,
6, 1, -2, 1, 3, -1, -8, -7, 1, -5,
2, -1, 2, 5, 1, -1, 6, -9, -1, 5,
-5, -9, 5, -9, 3, 3, 7, 3, -6, 15,
-5, 0, 1, -4, 1, -11, -3, 7, -1, -11,
-12, 3, -1, 19, 2, -3, -11, -4, 10, -14,
1, -1, 3, 3, 1, 5, 8, -3, 0, 2,
-4, -7, 3, 3, 2, -1, 0, -8, -6, -4,
-5, 9, -1, -4, 7, 2, 2, 2, 0, 1,
-5, -5, -5, 2, -1, 10, 7, 0, -8, 2,
2, 3, 8, -1, -5, 2, -5, -13, 4, -1,
6, -2, 0, -6, -10, -6, -1, -4, 1, 1,
3, -11, -8, 10, 10, -6, 10, 3, 2, 3,
4, -4, -4, 1, -11, 3, -4, -2, 4, 7,
-2, 0, 10, 1, 8, 2, 4, -2, -11, -1,
1, -4, 2, 6, 0, -5, -13, 0, 0, 4,
2, -5, -6, 1, -1, 6, -7, 8, 0, 1,
1, -4, -2, -1, -1, -1, -3, -7, -11, 1,
6, 0, 0, 4, 1, 0, 2, 2, 2, -5,
-2, 4, -2, -12, 8, -5, -3, 0, -1, -2,
3, -1, 9, -3, 0, -1, -1, -3, -1, 1,
4, -4, 0, 1, -3, 6, 10, -8, -2, 3,
-6, -11, -1, -6, -3, 4, -6, 7, 8, 6,
-6, -8, 5, -5, -7, -1, -2, -5, -3, 1,
2, -1, 0, 0, 0, -7, 7, 3, -5, 5,
13, 0, 0, 5, -5, 0, 0, -2, 3, 5,
0, 3, -8, -1, -5, -2, 2, -6, 7, -1,
0, 5, 10, 8, 3, 2, 2, -2, 1, -2,
-8, -11, -7, -5, -14, 2, -2, -6, -5, 2,
-9, 1, 1, 1, 2, -5, 8, -1, 4, 0,
3, 6, -11, 1, 6, -7, 1, 7, 1, -7,
0, -3, 5, -6, -1, -1, 7, 0, 2, 1,
0, 2, -3, 5, 11, -3, -2, 1, 5, -6,
-15, 6, 3, 8, 5, -16, 13, -4, -1, 2,
-10, -3, -8, -1, 10, -2, -8, -4, -7, 6,
5, -5, 0, -1, -5, 2, 6, -10, -8, 7,
-1, -7, 11, 1, -4, -12, 1, -4, -1, -4,
8, -6, -7, 4, 6, 5, 7, 0, -7, 1,
-1, 5, 5, 5, 6, -3, 6, -3, -5, 4,
-7, -5, -2, 2, -7, -8, 3, 9, 5, 2,
3, -1, -14, -1, 4, 6, -3, -12, 5, -4,
4, -3, -2, 6, -23, -8, 4, 7, 11, 6,
4, -5, -7, -3, 8, 9, -6, -13, -3, 5,
-2, 2, -3, -2, 6, -1, -6, 1, -1, -5,
-8, -1, -3, 4, 2, 12, -2, -2, -3, 3,
-3, 1, -4, -2, -3, 11, 3, -3, 4, 2,
-2, 6, -4, -10, 9, -13, -5, -4, 5, -1,
-6, 5, 1, -4, 1, -6, 2, -6, 9, 0,
5, 1, 2, 8, 1, -2, -3, -2, 6, -6,
-1, 1, 1, 2, -1, 4, -3, 1, -2, -5,
-6, -2, 4, -9, -8, 2, -7, -6, 8, 4,
-10, 4, 4, 3, 6, -4, 7, -8, 5, -5,
2, 0, 10, -7, 3, -5, -5, -14, 4, -2,
-4, -3, 11, -1, 4, 6, 5, 9, 6, 2,
0, 3, -8, -4, -9, -2, -8, 0, 3, -3,
-1, -3, 6, 2, -6, 9, 3, -2, 0, 4,
5, -7, 1, 0, 1, 1, -3, 6, 4, -1,
7, 1, -4, 0, -1, -13, 7, -5, -10, -8,
3, 0, 1, -2, -2, 0, -7, 0, -7, 1,
-2, -2, -1, -5, 6, 3, 6, -3, 5, -5,
-5, 3, 8, -4, 10, -5, 3, 2, -4, -4,
5, -5, 0, 6, 6, -1, -2, -7, 7, 3,
-4, 7, 0, -3, -7, -1, -6, -7, 1, 0,
6, 6, -1, -3, 1, -12, 0, -2, 1, 5,
-11, 6, -5, 3, -1, 7, -9, -11, 4, -7,
-8, 7, 1, 9, 14, -4, 10, 6, -10, -4,
0, 0, 3, 4, -7, 4, -9, 1, -3, -8,
0, -2, -2, -5, 5, 7, 6, -5, -4, -3,
2, 2, 9, 5, 4, -5, -4, -2, 5, -7,
3, 3, -1, 0, -3, 1, -4, -1, 1, -7,
-13, -4, -3, -1, -4, -3, 7, -5, 3, -3,
-5, 2, 5, 3, 6, 2, 5, 10, 2, -3,
-4, -12, -2, 0, -9, 1, 0, 4, -6, -1,
-6, 4, -4, 2, 9, 3, -3, -1, 3, 2,
2, 2, 1, 3, -2, -3, 3, -2, 1, 0,
-2, -4, 4, 0, 3, 5, 0, -7, 5, -9,
-1, -1, -9, 1, -3, -9, -5, -7, 1, 4,
-4, 6, 1, -6, -3, 1, -1, 0, -3, 7,
6, 6, -5, -4, 5, -7, 0, 0, 3, 4,
-12, -4, 6, 3, -1, -5, 2, 1, 3, -6,
-3, 0, 4, -4, 8, 6, -5, -2, 6, 1,
6, 13, -3, 5, 3, -4, -9, 1, -1, -2,
-5, -11, -11, 0, 4, -5, 6, 1, 8, -7,
-3, 5, -15, 2, -4, -3, -9, 5, 6, 10,
-8, -2, -5, -2, -1, 3, 8, 0, 15, 5,
-3, 3, 4, 6, -3, 1, -12, -7, -5, -1,
-1, 6, 2, -2, 1, -7, 1, 4, -3, -4,
13, 1, 0, -3, 5, 0, 1, 3, -4, 2,
-12, -6, 4, -5, -5, 10, -7, -17, -6, -12,
0, 1, 1, 12, -6, -1, 2, -3, 2, 2,
-9, 6, -3, 12, 3, 2, 4, 1, -7, -3,
-5, 3, 4, 1, 4, 10, -1, -3, -5, -4,
1, 2, 0, 1, 2, 2, 1, 3, -3, 1,
-5, -5, -4, 9, -7, -2, 6, -17, 2, -5,
1, -3, 1, 5, -1, 6, 2, -8, -3, -2,
-4, -8, -3, -1, 10, 3, 12, -5, 8, 1,
-6, -2, -9, -1, 0, 10, -4, 0, -4, 0,
4, -8, -7, 3, 0, 0, 6, 0, 4, -3,
3, -4, 6, -5, 4, -2, -9, 0, 2, 3,
-8, -3, 0, -2, 0, -5, 6, 1, -1, 0,
-10, 11, -9, 4, 10, 0, 0, 7, -5, -10,
5, -8, 1, 1, -2, 4, 1, -1, -2, 1,
-3, -1, -5, -3, 17, -3, -1, -5, -1, 9,
-12, 0, 1, -3, 2, 2, 2, -2, -3, -3,
-2, 2, -7, -5, 3, -10, 2, 0, 6, -2,
2, 3, 0, 2, 2, -5, 3, 1, -1, 6,
-4, -8, 5, 2, -2, 3, -8, -2, -12, -6,
-6, -4, 2, 9, 0, 1, 8, 6, -10, 5,
1, -7, -5, 3, 3, 4, 4, -1, -4, 6,
1, 6, -4, 0, -1, -4, -1, -6, 9, 2,
-9, -4, 6, -4, 8, -4, -3, 4, -2, -2,
-6, 1, -4, 3, 8, 6, -3, -13, -5, 6,
4, 2, 3, -2, 2, 1, 3, 2, -8, -4,
6, -13, -3, -7, -6, 2, -7, 6, 0, -9,
3, 7, 0, -8, 2, 6, -3, 0, -3, 0,
1, 2, 1, 4, 4, 0, 8, -6, -2, 1,
0, 2, -1, -1, 6, -3, 2, -6, -6, 0,
0, -6, 5, -4, -1, -2, 11, -6, -1, 6,
4, -5, -3, 0, -3, -2, 7, -1, -9, 9,
6, -9, 13, 8, 2, -12, -5, -7, -7, -9,
10, -5, 5, 7, -10, 0, 2, -10, -4, 1,
7, -1, -3, -5, -1, 0, 2, 0, 5, -8,
2, 3, -5, 7, 10, 0, -7, 3, 1, 3,
-4, 5, 6, 1, -5, -2, -6, 1, 4, -4,
-7, -2, 8, 8, 1, 3, -18, 0, 12, 1,
0, 10, -3, 2, -5, -1, 1, 10, -3, 2,
-1, -6, -1, -3, -2, -1, -1, -6, 3, 3,
-14, 3, -12, -13, -4, -6, -1, 1, 2, 5,
-2, 4, -1, 3, 5, 1, 5, 1, -3, 1,
16, -2, 0, -2, -1, -9, 3, 1, 1, 6,
4, -4, -7, -6, -1, -6, 2, 5, -7, -1,
10, 10, 0, 3, 0, 0, 3, -16, 5, -8,
-8, 3, 11, -6, -7, 5, 0, 5, -7, -4,
-11, 0, -6, -4, -4, -2, -3, 0, 2, 4,
9, -1, 1, -1, 5, 0, 5, 6, 5, 0,
-9, 0, -4, 0, 0, 1, -1, 1, -5, 4,
10, -5, -3, -7, -2, -4, 7, 1, 4, 4,
7, -7, -8, 7, 2, 0, -8, -3, 1, 2,
5, -1, -5, -4, -1, -4, -1, 1, 1, -7,
4, 0, -5, 6, -4, -7, -8, 2, 10, 2,
8, -2, 2, -3, -9, -1, 6, 1, -1, -1,
-4, -8, -7, 6, 1, -3, -2, -3, -1, -1,
1, -5, 0, 0, 0, 3, 5, -6, -2, 12,
2, -4, 7, 3, -2, -2, 2, -1, -9, 3,
-3, -3, 0, 0, -7, 1, -12, 7, -3, -2,
-1, 4, 5, -1, -6, 8, -1, -2, 4, -7,
-2, -2, 1, 4, 5, 1, -1, 3, 3, -4,
-9, -8, 14, 2, 6, -9, -7, -5, -1, 5,
3, -9, 6, 2, 6, 4, -7, 2, -6, -1,
8, -4, -7, -4, -1, -2, 4, 5, -1, 7,
-14, 6, 0, -7, 2, 8, 1, -2, -3, -4,
-5, 2, -5, -2, 2, -2, 4, -5, 6, -5,
2, -1, 0, 2, 1, 1, 3, 11, 6, -7,
5, 3, -6, 1, 5, -6, 5, -1, 5, 13,
-3, 0, -3, -3, -1, 1, -8, 7, 0, -1,
0, 0, 2, -3, 2, -1, 3, -1, -11, -5,
1, -12, -3, -2, -5, 1, -6, -6, -2, -1,
8, -8, -6, -8, 6, -6, 0, 1, -1, 0,
0, 5, 2, 2, 3, -5, 2, -1, -4, 8,
10, -2, -1, 2, 5, -3, -6, 7, 1, 3,
-5, 8, 2, 14, 0, 5, -1, 0, -8, 4,
-5, -4, 1, -7, 0, -5, 10, -6, -8, 5,
-6, -2, -13, 4, -2, 3, -5, 0, -4, -6,
1, -6, 3, -5, -5, 4, 7, -5, 2, -3,
1, -2, -2, 1, 4, -6, -1, -5, 0, 6,
3, -5, -2, 7, -1, 9, 7, -9, 0, -7,
7, 1, 9, 12, 4, 4, -8, 5, -6, -4,
0, 5, -4, 3, -3, -5, -4, 1, -6, -4,
-13, -3, -8, -13, 5, 7, 2, 4, -10, 3,
1, 2, 6, -3, 6, 2, -10, 2, -1, 2,
-7, -3, 1, -3, 0, -8, 6, 4, 0, -3,
5, 5, 5, 3, 5, 1, -9, 9, 4, 2,
-6, 1, -6, 1, 11, -13, -6, 1, 1, -11,
6, 3, 0, 10, -14, -3, 0, 4, -7, 0,
0, 0, -5, -8, -5, -9, -3, 2, 2, 7,
8, 6, -4, -3, -5, -5, 6, -4, 2, 1,
-3, -4, 5, -1, -2, 3, -1, -3, -8, 4,
11, 3, 6, 7, 4, 6, 4, -2, -9, 1,
-11, 3, -2, -10, -6, 1, 10, -2, -11, 6,
4, -1, -4, -1, -1, -5, -8, 2, 11, 4,
0, 4, 11, -8, 3, -3, -7, -2, 3, 2,
-9, -4, -2, 4, -2, -3, -3, -2, -3, 4,
-4, -4, -2, -1, -4, 5, -1, 1, -8, 1,
-4, 7, -1, 9, 10, 4, 5, 3, 4, -3,
7, -3, -12, -3, -13, 2, -3, -5, -1, 5,
2, -3, -5, -5, 12, -6, 11, 4, -3, 0,
10, 7, 0, -9, 5, 2, -1, -8, -11, 2,
-9, 3, -1, -1, -1, -3, -2, -1, -1, 2,
0, -9, 0, 6, 4, -5, -2, 6, -2, -7,
9, -5, 10, -8, 1, 5, 0, 4, 0, 3,
4, -3, 10, 2, 2, -11, -7, 2, 5, -3,
-5, 13, -4, -7, 9, -7, -5, -10, -3, 3,
10, -1, 4, -4, 1, -10, -3, -3, 3, -8,
5, -1, -2, -7, -4, 6, -2, 0, -4, -7,
-6, 1, -5, 0, -7, -5, 11, 1, -3, 3,
-2, 0, -6, 7, 3, 0, 7, 2, -2, 9,
0, 9, 11, 3, -6, -1, 1, -7, 6, 9,
-7, -11, -2, 14, 1, 6, -10, -13, -1, -13,
6, 1, -1, 3, 0, -2, -5, 0, -1, -7,
-6, 0, 0, 2, 0, -1, 1, 2, -5, 3,
-2, -6, -4, -1, 1, -5, 0, -2, 8, 1,
-9, -4, 5, -2, 4, 2, 12, -3, -2, 2,
5, -5, 4, 11, -3, 1, 7, 8, -12, -5,
-3, 4, -6, -4, -1, -8, 3, -1, 0, 1,
6, -3, -10, 2, -8, 6, 12, -6, 4, -11,
-4, -3, 4, 0, 1, 2, 1, -1, -3, 1,
-2, 2, 9, -2, -1, -2, 2, 1, -1, -6,
11, 2, -7, 1, 0, 8, -5, 4, 0, -2,
1, 9, -2, 9, 0, 3, -6, 1, -9, 2,
-6, -2, 2, 1, 14, -9, -2, -3, 0, -5,
2, -3, -15, 7, -8, -8, -4, 8, -3, -8,
5, -2, 0, -3, 0, 4, -1, -8, 2, 2,
6, 2, -3, 6, 0, 1, 8, -4, -4, 2,
3, -4, -4, 2, 2, 4, 4, -1, -4, 4,
9, -6, 5, -5, -3, 8, -1, 2, -4, 4,
-1, -8, 6, 5, 1, 0, -3, -8, -6, 7,
-7, -12, 7, -9, -1, 2, 1, -5, 1, 1,
4, -5, -1, -7, -5, 6, -3, -2, 0, -7,
5, 3, -1, 11, 5, 3, -4, -5, -10, -7,
8, 0, 6, -1, 6, 7, 0, 11, 2, -4,
0, 0, 0, 3, -2, 6, 4, 4, -4, -3,
-3, -2, 3, -12, 7, 3, 7, 1, 0, -4,
-7, -6, -7, 4, -5, -3, 4, 0, -1, -5,
-5, 0, -5, 4, -3, 5, -8, 7, 0, -1,
-1, 0, 4, 0, -2, 1, 0, 1, -1, 3,
-12, -9, 3, -2, 1, 1, -14, 2, 5, 12,
-17, 7, 4, -1, 10, 1, -6, 7, -1, -1,
-2, 3, 0, -6, -5, 1, 3, 8, -4, -4,
4, -4, -15, 5, -8, 5, -1, 6, -6, -3,
6, 2, -5, 5, 8, -3, 0, -3, -5, 7,
-5, -3, -1, 8, -3, -3, -3, 4, 2, 1,
3, -3, -1, 6, -1, 3, -2, 13, -5, -5,
5, 1, -1, -11, -11, 2, 6, 2, -1, -2,
-3, 8, 3, -5, 3, -12, 0, 5, 9, -16,
-12, -11, 6, 10, -4, -8, 9, -2, -3, 1,
3, 7, -2, 0, 0, -3, 1, -6, -4, 5,
8, 5, 0, 5, -3, 0, -1, 0, -4, -3,
9, -11, -6, 2, -1, 2, 4, 1, -2, -5,
9, -2, 3, 3, 0, -3, 9, -15, -7, -8,
-4, -4, 0, 1, -9, -3, -1, 9, -20, 6,
1, 5, 3, 1, 5, 7, 4, -1, -2, -10,
1, -2, -3, 2, -2, 2, 0, -3, 2, 3,
-5, -2, -3, 2, 2, -1, -1, 0, 6, 0,
-3, 1, -5, 3, -4, 3, 6, -5, -3, -3,
-4, 0, 5, 5, 10, 2, -11, 9, 6, 5,
-8, 0, 5, 4, 0, -3, -11, 8, -8, -1,
3, -5, -6, -7, 8, 10, 0, 4, 0, -2,
-14, -5, 2, 7, -6, 3, -3, 0, 7, 4,
-1, 0, -8, -1, -2, -2, 2, -5, -3, 3,
-16, 13, 5, -7, -3, -8, -10, -3, -7, 1,
-6, -5, 5, -4, 3, 7, 8, 10, 11, -3,
6, 3, 8, 3, 2, -9, 0, -6, 10, 3,
-1, -5, -2, 3, 5, 3, -8, -8, -3, 1,
-9, -5, -2, -6, -7, -3, -2, 1, 0, 3,
0, -5, -2, 6, -3, 5, -1, -3, -2, 0,
-5, -1, -1, 8, 0, -2, -3, -5, -4, -11,
1, -6, 0, 7, -2, 4, 6, 5, 3, 1,
1, 4, -5, 0, -7, 9, 1, 8, 3, -6,
1, 13, 2, 3, 6, 0, -4, -5, 0, 0,
-16, 1, 3, -3, 0, 7, 0, -3, -8, 13,
4, 0, -3, 4, -4, -7, -2, -1, -1, 1,
};
double CloseMin,CloseMax;
double diff, diffmult, base;
int summ, offset, ibase;
CloseMin = a0[ArrayMinimum(a0,FilterDepth,1)];
CloseMax = a0[ArrayMaximum(a0,FilterDepth,1)];
diff = CloseMax - CloseMin;
diffmult = 100.0 / diff;
for (int i=1; i <=FilterDepth; i++)
{
base = MathRound( (a0[i] - CloseMin) * diffmult ) + offset;
ibase = base; //integerize
summ += ar1[ibase];
offset = FilterDepth * i;
}
return(summ);
}
'IT관련' 카테고리의 다른 글
일목균형표를 활용한 메타트레이더 EA 1 (0) | 2023.03.07 |
---|---|
일목균형표에 대한 요약 (0) | 2023.03.07 |
메타트레이더 EA - Winner H4 (0) | 2019.09.21 |
메타트레이더 EA - RT IlmokCloud (0) | 2019.09.20 |
메타트레이더 EA - Named Pipe Sub (0) | 2019.09.19 |