2 Bijlage (s) Hallo,
Ik probeer een stochastiek te coderen voor M1 die de gegevens van M15 opneemt. Op een of andere manier werkt het niet. geprobeerd om erachter te komen. Elke senior kan me helpen. dank je!!
Hier is de M15 (IMG 1_4). zoals je op de grafiek kunt zien dat de pijl hier in M15 verschijnt. Stoch bevindt zich op OB en MACD is onder 0.
Hier bij M1 (IMG 2_4) staat Stoch op OB, maar er is geen pijl.
Dus ik zal de indior in het M1-diagram plaatsen.
De indior werkt op deze manier, wanneer M15 Stoch op OB staat en MACD lager dan 0 is en M1 Stoch op OB staat, verschijnt er een pijl op de kaart (M1)
Hier is mijn hele code
Code #property indior_chart_window #property indior_buffers 2 #property indior_plots 2/--- Arrow #property indior_label1 ArrUp #property indior_label2 ArrDn/--- invoerparameters enum eprice {s0 = 0,/LAAGHOOG s1 = 1/SLUITENSLUITEN};/------------------------------------------------ ---------------------------------------- invoertekenreeks __________ 1 __________ = xxxxxxxxxxxxxxxxxxxxx; invoertekenreeks __________ 2 __________ == ALERT =;/PIJLWAARSCHUWING EN KENNISGEVINGEN, invoertekenreeks __________ 3 __________ = xxxxxxxxxxxxxxxxxxxxx; input bool ARROW = true;/LAAT PIJL-invoertekenreeks __________ 4 __________ = xxxxxxxxxxxxxxxxxxxxx; invoerreeks __________ 5 __________ == PIJLCODE =;/PIJLGEGEVENS invoertekenreeks __________ 6 __________ = xxxxxxxxxxxxxxxxxxxxx; invoer int ARROWUP = 217;/PIJLCODE invoer int ARROWDN = 218;/PIJLCODE invoer kleur ARROWUPc = clrWhite;/Pijl omhoog Kleur invoerkleur ARROWDNc = clrWhite;/Pijl Dn Kleur invoer string __________ 10 __________ = xxxxxxxxxxxxxxxxxxxxx; invoerreeks __________ 11 __________ == M15 OB OS =;/OB OS, invoerreeks __________ 12 __________ = xxxxxxxxxxxxxxxxxxxxx; dubbele invoer sto_dn_level = 20.0;/NIVEAU Beneden dubbele invoer sto_up_level = 80.0;/NIVEAU Omhoog invoerprijs prijs sto_price = 1;/PRIJSVELD/------------------ -------------------------------------------------- --------------------/--- indiorbuffers verdubbelen ArrUpBuffer # 91; # 93 ;; dubbele ArrDnBuffer # 91; # 93 ;;/---/ ------------------------------------------ ------------------------ /| Aangepaste indior initialisatie functie |/ ----------------------------------------------- ------------------- int OnInit () {//--- indiorbuffers 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 time # 91; # 93 ;, const double open # 91; # 93 ;, const double high # 91; # 93 ;, const double low # 91; # 93 ;, const double close # 91; # 93 ;, const long tick_volume # 91; # 93 ;, const long volume # 91; # 93 ;, const int spread # 91; # 93;) {//--- int i, limit; limit = rates_total-prev_calculated; if (prev_calculatedgt; 0) = maximum limit 2; for (i = limit-2; igt; = 0; i--) {if (ARROW 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 iStochastic (_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 (ARROW 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 (_Symbool, 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_price, 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); }/ ---------------------------------------------- -------------------- dubbele 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;kleur # 93;