Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools

Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools (http://www.expert-advisor.com/forum/index.php)
-   Programmierung MQL4 (http://www.expert-advisor.com/forum/forumdisplay.php?f=220)
-   -   custom indikator auslesen (http://www.expert-advisor.com/forum/showthread.php?t=4073)

degu35 09.02.15 00:26

custom indikator auslesen
 
hallo habe noch ein problem

habe mir untenstehenden indikator zu grunde gelegt für einen EA. ich komme nur nicht weiter wie ich die buffer richtig auslese. der indi zeichnet rote und blaue bars je nach trend. ich wollte jetzt auslesen wann er die roten bars zeichnet und ein signal auslösen. und umgekehrt.
hat vielleicht mal einer zeit sich das ding anzuschauen und mir weiterzuhelfen?

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Yellow
#property indicator_color2 Yellow
#property indicator_color3 Red
#property indicator_color4 Red
#property indicator_color5 Blue
#property indicator_color6 Blue

extern int MAPeriod = 7;
extern int MAMethod = 1;
extern int AVGFilter = 3;
extern int BBPeriod = 15;
extern int BBDeviation = 1;
extern int BBShift = 1;
double G_ibuf_100[];
double G_ibuf_104[];
double G_ibuf_108[];
double G_ibuf_112[];
double G_ibuf_116[];
double G_ibuf_120[];

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
IndicatorBuffers(6);
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(0, G_ibuf_116);
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(1, G_ibuf_120);
SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(2, G_ibuf_108);
SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(3, G_ibuf_112);
SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(4, G_ibuf_100);
SetIndexStyle(5, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(5, G_ibuf_104);
return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
int Li_4 = IndicatorCounted();
if (Li_4 > 0) Li_4--;
int Li_0 = Bars - Li_4;
double ima_8 = 0;
double ima_16 = 0;
double ibands_24 = 0;
double ibands_32 = 0;
for (int Li_40 = 0; Li_40 < Li_0; Li_40++) {
ima_8 = iMA(Symbol(), Period(), MAPeriod, 0, MAMethod, PRICE_CLOSE, Li_40);
ima_16 = iMA(Symbol(), Period(), 21, 0, MODE_SMA, PRICE_CLOSE, Li_40);
ibands_24 = iBands(Symbol(), Period(), BBPeriod, BBDeviation, BBShift, PRICE_CLOSE, MODE_UPPER, Li_40);
ibands_32 = iBands(Symbol(), Period(), BBPeriod, BBDeviation, BBShift, PRICE_CLOSE, MODE_LOWER, Li_40);
G_ibuf_116[Li_40] = MathMax(ibands_24, MathMax(ima_8, ima_16));
G_ibuf_120[Li_40] = MathMin(ibands_32, MathMin(ima_8, ima_16));
if (ima_8 > ima_16) {
G_ibuf_100[Li_40] = MathMax(ibands_24, MathMax(ima_8, ima_16));
G_ibuf_104[Li_40] = MathMin(ima_8, ima_16);
} else {
G_ibuf_108[Li_40] = MathMax(ibands_24, MathMax(ima_8, ima_16));
G_ibuf_112[Li_40] = MathMin(ima_8, ima_16);
}
}
return (0);
}

Deepack 09.02.15 09:23

hallo
den indikator kannst du direkt ansprechen und musst nicht
vorher den quelltext lesen

iCustom(Symbol(),Period(),"indikatorname", extern1,extern2,... Mode, Shift);
mode 0-7 gibt dir die werte der linien retour
im MetaTrader - Datenfenster zeigt dir welchen wert du suchst

lg

degu35 09.02.15 10:26

Liste der Anhänge anzeigen (Anzahl: 1)
hallo

das mit dem icustom befehle is klar. ich hab mal versucht mit unteren programm die daten sichtbar zu machen aber bekomme nur für mich unverständliche werte.hab dir mal ein bild mit angehängt. vielleicht weist du ja wo mein denkfehler sitzt. ich müsste doch so etwas hinbekommen wie;

buffer1 > buffer2 == rote balken oder soetwas?

void OnTick()
{

double forexprofit0 = iCustom(NULL,0,"ForexProfitBoost",7,1,3,15,0,1);
double forexprofit1 = iCustom(NULL,0,"ForexProfitBoost",7,1,3,15,1,1);
double forexprofit2 = iCustom(NULL,0,"ForexProfitBoost",7,1,3,15,2,1);
double forexprofit3 = iCustom(NULL,0,"ForexProfitBoost",7,1,3,15,3,1);
double forexprofit4 = iCustom(NULL,0,"ForexProfitBoost",7,1,3,15,4,1);
double forexprofit5 = iCustom(NULL,0,"ForexProfitBoost",7,1,3,15,5,1);

if (OrdersTotal()<0){

if (forexprofit2>forexprofit4){

OrderSend(NULL,OP_BUY,0.01,Ask,3,0,0,"trade",0,0,R ed);
}}


ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
ObjectSetText("ObjName","Speicher0="+forexprofit0, 7, "Verdana", Yellow);
ObjectSet("ObjName", OBJPROP_CORNER, 0);
ObjectSet("ObjName", OBJPROP_XDISTANCE, 20);
ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);

ObjectCreate("mein", OBJ_LABEL, 0, 0, 0);
ObjectSetText("mein","Speicher1="+forexprofit1,7, "Verdana", Yellow);
ObjectSet("mein", OBJPROP_CORNER, 0);
ObjectSet("mein", OBJPROP_XDISTANCE, 20);
ObjectSet("mein", OBJPROP_YDISTANCE, 30);

ObjectCreate("mein1", OBJ_LABEL, 0, 0, 0);
ObjectSetText("mein1","Speicher2="+forexprofit2,7, "Verdana", Yellow);
ObjectSet("mein1", OBJPROP_CORNER, 0);
ObjectSet("mein1", OBJPROP_XDISTANCE, 20);
ObjectSet("mein1", OBJPROP_YDISTANCE, 40);

ObjectCreate("mein2", OBJ_LABEL, 0, 0, 0);
ObjectSetText("mein2","Speicher3="+forexprofit3,7, "Verdana", Yellow);
ObjectSet("mein2", OBJPROP_CORNER, 0);
ObjectSet("mein2", OBJPROP_XDISTANCE, 20);
ObjectSet("mein2", OBJPROP_YDISTANCE, 50);

ObjectCreate("mein3", OBJ_LABEL, 0, 0, 0);
ObjectSetText("mein3","Speicher4="+forexprofit4,7, "Verdana", Yellow);
ObjectSet("mein3", OBJPROP_CORNER, 0);
ObjectSet("mein3", OBJPROP_XDISTANCE, 20);
ObjectSet("mein3", OBJPROP_YDISTANCE, 60);

ObjectCreate("mein4", OBJ_LABEL, 0, 0, 0);
ObjectSetText("mein4","Speicher5="+forexprofit5,7, "Verdana", Yellow);
ObjectSet("mein4", OBJPROP_CORNER, 0);
ObjectSet("mein4", OBJPROP_XDISTANCE, 20);
ObjectSet("mein4", OBJPROP_YDISTANCE, 70);

//---

}


Alle Zeitangaben in WEZ +2. Es ist jetzt 00:56 Uhr.

Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.1
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum