2 Anhang (e) Hallo,
Ich versuche, einen Stochastik für M1 zu kodieren, der die Daten von M15 nimmt. Irgendwie klappt es nicht. Ich habe versucht herauszufinden. Jeder Senior könnte mir helfen. Danke!!
Hier ist der M15 (IMG 1_4). Wie Sie auf der Karte sehen können, erscheint der Pfeil hier in M15. Stoch ist in OB und MACD ist unter 0.
Hier bei M1 (IMG 2_4) ist Stoch bei OB, aber es gibt keinen Pfeil.
Also werde ich den Indikator in M1-Diagramm setzen.
Die Anzeige funktioniert auf diese Weise, wenn M15 Stoch bei OB ist und MACD unter 0 ist und M1 Stoch bei OB ist, wird der Pfeil auf dem Diagramm erscheinen (M1)
Hier ist mein ganzer Code
Eingefügter Code #Eigenschaft indikator_Grafikfenster #Eigenschaft indikator_Puffer 2 #Eigenschaft indikator_Plots 2/--- Pfeil #Eigenschaft indikator_Label1 ArrUp #Eigenschaft indikator_Label2 ArrDn/--- Eingabeparameter Enum-Preis {s0 = 0,/NIEDRIGHOCH s1 = 1/SCHLIESSENSCHLIESSEN};/------------------------------------------------ ---------------------------------------- Eingabezeichenfolge __________ 1 __________ = xxxxxxxxxxxxxxxxxxxxx; Eingabezeichenfolge __________ 2 __________ == ALERT =;/ALARMPFEIL UND BENACHRICHTIGUNGEN, Eingabezeichenfolge __________ 3 __________ = xxxxxxxxxxxxxxxxxxxxx; Eingabe bool ARROW = true;/Eingabepfeil POWN ZEIGEN __________ 4 __________ = xxxxxxxxxxxxxxxxxxxxx; Eingabezeichenfolge __________ 5 __________ == PFEILCODE =;/ARROW DETAILS Eingabezeichenfolge __________ 6 __________ = xxxxxxxxxxxxxxxxxxxxx; int int ARROWUP = 217;/PFEILCODE input int ARROWDN = 218;/PFEILCODE-Eingabefarbe ARROWUPc = clrWhite;/Pfeil nach oben Farbe der Eingabefarbe ARROWDNc = clrWhite;/Pfeil Dn Eingabestring der Farbe __________ 10 __________ = xxxxxxxxxxxxxxxxxxxxx; Eingabezeichenfolge __________ 11 __________ == M15 OB OS =;/OB OS, Eingabezeichenfolge __________ 12 __________ = xxxxxxxxxxxxxxxxxxxxx; Eingang double sto_dn_level = 20.0;/LEVEL Eingang unten double sto_up_level = 80.0;/LEVEL Eingang oben eprece sto_price = 1;/PREIS FELD/------------------ -------------------------------------------------- --------------------/--- Anzeigepuffer doppelt ArrUpBuffer # 91; # 93 ;; Doppel ArrDnBuffer # 91; # 93 ;;/---/ ------------------------------------------ ------------------------ /| Benutzerdefinierte Indikatorinitialisierungsfunktion |/ ----------------------------------------------- ------------------- int OnInit () {//--- Indikator puffers mapping IndiorBuffers (2); SetIndexBuffer (0, ArrUpBuffer); SetIndexStyle (0, DRAW_ARROW, STYLE_SOLID, 1, ARROWUPc); SetIndexArrow (0, ARROWUP); SetIndexBuffer (1, ArrDnBuffer); SetIndexStyle (1, DRAW_ARROW, STYLE_SOLID, 1, ARROWDNc); SetIndexArrow (1, ARROWDN);/--- return (INIT_SUCCEEDED); }/ ---------------------------------------------- -------------------- int OnCalculate (const int rates_total, const int prev_calculated, const datetime Zeit # 91; # 93 ;, const double open # 91; # 93 ;, const doppelt hoch # 91; # 93 ;, const doppelt niedrig # 91; # 93 ;, const doppelt geschlossen # 91; # 93 ;, const lang tick_volume # 91; # 93 ;, const lang Volumen # 91; # 93; ;, const int spread # 91; # 93;) {//--- int i, limit; limit = rates_total-prev_calculated; if (prev_calculatedgt 0) limit = limit 2; für (i = limit-2; igt; = 0; i--) {if (PFEIL iMA (_Symbol, PERIOD_M15,50,0, MODE_EMA, PRICE_CLOSE, i) gt; iMA (_Symbol, PERIOD_M15,100,0, MODE_EMA , PRICE_CLOSE, i) iMA (_Symbol, PERIOD_M15,100,0, MODE_EMA, PRICE_CLOSE, i) gt; iMA (_Symbol, PERIOD_M15,200,0, MODE_EMA, PRICE_CLOSE, i) iMACD (_Symbol, PERIOD_M15,12,26,1 , PRICE_CLOSE, MODE_MAIN, i) gt; 0.0 iStochastisch (_Symbol, PERIOD_M15,3,1,3, MODE_EMA, (int) sto_price, MODE_MAIN, i) lt; = sto_dn_leveliStochastic (_Symbol, PERIOD_M15,3,1,3, MODE_EMA, (int) sto_price, MODE_SIGNAL, i) lt; = sto_dn_level iStochastic (_Symbol, PERIOD_M1,3,1,3, MODE_EMA, (int) sto_price, MODE_MAIN, i) lt; = sto_dn_level iStochastic (_Symbol, PERIOD_M1,3,1,3, MODE_EMA, (int) sto_price, MODE_SIGNAL, i) lt; = sto_dn_level) {ArrUpBuffer # 91; i # 93; = iLow (_Symbol, PERIOD_M1, i) -10 * pix_y ();} if (PFEIL iMA (_Symbol, PERIOD_M15,50,0, MODE_EMA, PRICE_CLOSE, i) lt; iMA (_Symbol, PERIOD_M15,100,0, MODE_EMA, PRICE_CLOSE, i) iMA (_Symbol, PERIOD_M15 , 100,0, MODE_EMA, PRICE_CLOSE, i) lt; iMA (_Symbol, PERIOD_M15,200,0, MODE_EMA, PRICE_CLOSE, i) iMACD (_Symbol, PERIOD_M15,12,26,1, PRICE_CLOSE, MODE_MAIN, i) lt; 0,0 iStochastic (_Symbol, PERIOD_M15,3,1,3, MODE_EMA, (int) sto_price, MODE_MAIN, i) gt; = sto_up_level iStochastic (_Symbol, PERIOD_M15,3,1,3, MODE_EMA, (int) sto_price, MODE_SIGNAL, i) gt; = sto_up_level iStochastic (_Symbol, PERIOD_M1,3,1,3, MODE_EMA, (int) sto_preis, MODE_MAIN, i) gt; = sto_u p_level iStochastic (_Symbol, PERIOD_M1,3,1,3, MODE_EMA, (int) sto_price, MODE_SIGNAL, i) gt; = sto_up_level) {ArrDnBuffer # 91; i # 93; = iHigh (_Symbol, PERIOD_M1, i) 10 * pix_y ();}} return (rates_total); }/ ---------------------------------------------- -------------------- double pix_y () {return ((ChartGetDouble (0, CHART_PRICE_MAX, 0) -ChartGetDouble (0, CHART_PRICE_MIN, 0))ChartGetInteger ( 0, CHART_HEIGHT_IN_PIXELS, 0)); }/ ---------------------------------------------- -------------------- # 91; color = # 666666 # 93; # 91; font = trebuchet ms # 93; # 91;font # 93; # 91;Farbe # 93;