I사용자 정의 기능 - 페이지 7

 

이 고급 ADX 표시기를 사용하여 EA 쓰기를 작성하고 싶습니다...표시기에서 값과 색상을 추출하는 방법...

구입하다

ADX 색상 녹색 및 (ADX 이번 시간> ADX 이전 시간)

팔다

ADX 색상 빨간색 및 (ADX 이번 시간 < ADX 이전 시간)

코딩을 직접 해보았습니다. 내 규칙에 맞는 코딩??여기서 도와주세요??

고마워

소닉

for (i = Bars - 205; i >= 0; i --)

{

double adx1 =iCustom(NULL, 0, "Advanced_ADX",13,0,i);

double adx2 =iCustom(NULL, 0, "Advanced_ADX",13,1,i);

if ((adx1>adx2)&&(adx1 > adx1) // BUY

{ BUY routine}

if ((adx1<adx2)&&(adx1 < adx1) // SELL

{ SELL routine}

}
파일:
 

I커스텀 인디케이터 EA

//+------------------------------------------------------------------+

//| This MQL is generated by Expert Advisor Builder |

//| http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/ |

//| |

//| In no event will author be liable for any damages whatsoever. |

//| |

//| |

//+------------------- DO NOT REMOVE THIS HEADER --------------------+

#define SIGNAL_NONE 0

#define SIGNAL_BUY 1

#define SIGNAL_SELL 2

#define SIGNAL_CLOSEBUY 3

#define SIGNAL_CLOSESELL 4

#property copyright "Expert Advisor Builder"

#property link "http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/"

extern int MagicNumber = 0;

extern bool SignalMail = False;

extern bool EachTickMode = True;

extern double Lots = 0.2;

extern int Slippage = 3;

extern bool UseStopLoss = True;

extern int StopLoss = 27;

extern bool UseTakeProfit = True;

extern int TakeProfit = 34;

extern bool UseTrailingStop = False;

extern int TrailingStop = 30;

int BarCount;

int Current;

bool TickCheck = False;

//+------------------------------------------------------------------+

//| expert initialization function |

//+------------------------------------------------------------------+

int init() {

BarCount = Bars;

if (EachTickMode) Current = 0; else Current = 1;

return(0);

}

//+------------------------------------------------------------------+

//| expert deinitialization function |

//+------------------------------------------------------------------+

int deinit() {

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start() {

int Order = SIGNAL_NONE;

int Total, Ticket;

double StopLossLevel, TakeProfitLevel;

if (EachTickMode && Bars != BarCount) TickCheck = False;

Total = OrdersTotal();

Order = SIGNAL_NONE;

//+------------------------------------------------------------------+

//| Variable Begin |

//+------------------------------------------------------------------+

double Buy1_1 = iOBV(NULL, 0, PRICE_LOW, Current + 0);

double Buy1_2 = iCustom(NULL, 0, "synthetic_", 22, 0, Current + 0);

double Sell1_1 = iOBV(NULL, 0, PRICE_HIGH, Current + 0);

double Sell1_2 = iCustom(NULL, 0, "synthetic_", 22, 0, Current + 0);

//+------------------------------------------------------------------+

//| Variable End |

//+------------------------------------------------------------------+

//Check position

bool IsTrade = False;

for (int i = 0; i < Total; i ++) {

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {

IsTrade = True;

if(OrderType() == OP_BUY) {

//Close

//+------------------------------------------------------------------+

//| Signal Begin(Exit Buy) |

//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

//| Signal End(Exit Buy) |

//+------------------------------------------------------------------+

if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Close Buy");

if (!EachTickMode) BarCount = Bars;

IsTrade = False;

continue;

}

//Trailing stop

if(UseTrailingStop && TrailingStop > 0) {

if(Bid - OrderOpenPrice() > Point * TrailingStop) {

if(OrderStopLoss() < Bid - Point * TrailingStop) {

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);

if (!EachTickMode) BarCount = Bars;

continue;

}

}

}

} else {

//Close

//+------------------------------------------------------------------+

//| Signal Begin(Exit Sell) |

//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

//| Signal End(Exit Sell) |

//+------------------------------------------------------------------+

if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, DarkOrange);

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Close Sell");

if (!EachTickMode) BarCount = Bars;

IsTrade = False;

continue;

}

//Trailing stop

if(UseTrailingStop && TrailingStop > 0) {

if((OrderOpenPrice() - Ask) > (Point * TrailingStop)) {

if((OrderStopLoss() > (Ask + Point * TrailingStop)) || (OrderStopLoss() == 0)) {

OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);

if (!EachTickMode) BarCount = Bars;

continue;

}

}

}

}

}

}

//+------------------------------------------------------------------+

//| Signal Begin(Entry) |

//+------------------------------------------------------------------+

if (Buy1_1 != Buy1_2) Order = SIGNAL_BUY;

if (Sell1_1 != Sell1_2) Order = SIGNAL_SELL;

//+------------------------------------------------------------------+

//| Signal End |

//+------------------------------------------------------------------+

//Buy

if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

if(!IsTrade) {

//Check free margin

if (AccountFreeMargin() < (1000 * Lots)) {

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}

if (UseStopLoss) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;

if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("BUY order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");

} else {

Print("Error opening BUY order : ", GetLastError());

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0);

}

}

//Sell

if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

if(!IsTrade) {

//Check free margin

if (AccountFreeMargin() < (1000 * Lots)) {

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}

if (UseStopLoss) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0;

if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0;

Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("SELL order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Open Sell");

} else {

Print("Error opening SELL order : ", GetLastError());

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0);

}

}

if (!EachTickMode) BarCount = Bars;

return(0);

}

//+----------------------------------------------------------------

안녕하세요

이것은 나의 시작이다

이중 구매1_1 = iOBV(NULL, 0, PRICE_LOW, 현재 + 0);

이중 구매1_2 = iCustom(NULL, 0, "합성_", 22, 0, 현재 + 0);

이중 Sell1_1 = iOBV(NULL, 0, PRICE_HIGH, 현재 + 0);

이중 Sell1_2 = iCustom(NULL, 0, "합성_", 22, 0, 현재 + 0);

내 사용자 지정 지표가 obv 라인을 넘을 때 시장을 판매하거나 구매하고 싶습니다.

하지만

작동하지 않는다

코드에 무엇이 잘못 되었습니까?_

 

2색인디

안녕하세요 여러분,

맨 아래의 인디(Complex_Pairs1)에는 단 하나의 색상만 있습니다. 누구든지 나를 도울 수 있고 대신 2 가지 색상으로 변경할 수 있습니다. 파란색은 상승, 빨간색은 하강입니다. 차트의 인디와 같습니다(실행 라인).

코드를 직접 변경하기 위해 열심히 노력했지만 성공하지 못했습니다.

컴파일 후 오류는 없었지만 indi를 열려고 하면 아무 일도 일어나지 않습니다.

이것은 아마도 모든 숙련된 코더를 위한 케이크 조각일 것입니다.

감사합니다!

클론다이크

파일:
 

문서 또는 포럼 스레드를 찾고 계십니까?

안녕하세요, 사용자 지정 지표 를 전문가에게 표시하는 방법에 대해 Google에서 사용자 가이드 또는 포럼 스레드를 검색하려고 했습니다. 나는 실제로 iCustom 기능과 몇 가지 예를 더 잘 사용하는 방법에 대한 정보를 원합니다. 미리 감사드립니다!

 

스레드를 iCustom 함수 스레드로 옮겼습니다.

모든 것을 찾을 수 있기를 바랍니다.

이 게시물도 참조하십시오 https://www.mql5.com/en/forum

 

요점을 얻었습니다 감사합니다!

 

mQL ea에 추가하는 방법을 아는 사람이 있습니까?

icustom 함수를 사용하여 지그재그 표시기.

나는 시도했다

더블 x = iCustom(NULL,PERIOD_M5,"지그재그",3,0,0);

하지만 내 인쇄 기능 에서 다양한 숫자를 얻고 있습니다.

다양한 숫자도 시도해봤다.

도움을 주시면 감사하겠습니다.

파일:
zigzag.mq4  7 kb
 
ajk:
mQL ea에 추가하는 방법을 아는 사람이 있습니까?

icustom 함수를 사용하여 지그재그 표시기.

나는 시도했다

더블 x = iCustom(NULL,PERIOD_M5,"지그재그",3,0,0);

하지만 내 인쇄 기능에 다양한 숫자가 표시됩니다.

다양한 숫자도 시도해봤다.

도움을 주시면 감사하겠습니다.

한 가지 방법은 다음과 같습니다. iCustom(NULL,0,"ZigZag",깊이,편차,백스텝,0,1)

 

지그재그

헤이 ajk....... 지그재그는 대부분의 시간에 대해 값이 0이고 가끔 0이 아닌 숫자만 있다는 점에서 대부분의 표시기와 다릅니다. 이는 표준 iCustom 형식에서 거의 사용할 수 없게 만듭니다. .....

// ---> 지그 = iCustom(NULL,0,"지그재그",15,5,3, 0, i);

유용하려면 거의 확실히 모든 "0이 아닌" 숫자를 저장할 배열을 만들어야 합니다.

if(지그>0)

{

zag[n] = 지그;

}

그런 다음 일반적인 작업을 수행할 수 있습니다.

if(zag[1] > zag[2]) // 이렇게 합니다.

그렇지 않으면 // 또는

if(zag[1] < zag[2]) // 그렇게 한다

//------------

거기에 조금 더 있지만 그것이 기본 아이디어입니다 ..... h

 

도움이 필요하다

안녕..

유니버설 MA 크로스 EA를 찾았습니다.

좋은 EA입니다..

파일: