Announcement

Collapse
No announcement yet.

Indicatori/Experti/Scripte

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • dHigh = High[pos]; asta e linia 57?

    si daca pos=0 si tu ceri High(0) ce se intampla?

    Comment


    • Code:
      int counted_bars = IndicatorCounted();
      //---- check for possible errors
         if (counted_bars<0) return(-1);
      //---- last counted bar will be recounted
         if (counted_bars>0) counted_bars--;
         int pos = Bars - counted_bars;
      De aici reiese ca pos nu poate fi 0. Sau cel putin eu asa inteleg.
      A good trade is when I Break Even. A great trade is when I Take Profit.

      Comment


      • while(pos>=0) si de ce nu modifici asta?
        ex: while(pos>0)

        int counted_bars = IndicatorCounted();
        //---- check for possible errors
        if (counted_bars<0) return(-1);
        //---- last counted bar will be recounted
        if (counted_bars>0) counted_bars--;
        int pos = Bars - counted_bars;

        si daca counted bar = 1 il faci 0 si daca e deja 0 nu il modifici:
        int pos = Bars? - 0

        nu stiu cat e Bars.

        problema e cand apelezi High(0)
        Last edited by iulik; 7th December 2015, 12:33 PM.

        Comment


        • IndicatorCounted

          The function returns the amount of bars not changed after the indicator had been launched last.

          int IndicatorCounted();

          Returned value

          The amount of bars not changed after the indicator had been launched last.

          Deci, counted_bars este diferit de 0.
          A good trade is when I Break Even. A great trade is when I Take Profit.

          Comment


          • nu am incredere nici in engleza mea nici in documentatia lor:

            while(pos>=0)
            {print (pos); nu mai stiu exact cum era functia dar poti sa vezi in log.

            Comment


            • Am incercat sa adaptez si codul din helpul fct. IndicatorCounted (). Nu merge nimic.
              A good trade is when I Break Even. A great trade is when I Take Profit.

              Comment


              • daca nu depistezi pana diseara ma uit si eu.

                Comment


                • Ok, 10x.
                  A good trade is when I Break Even. A great trade is when I Take Profit.

                  Comment


                  • Am gasit:

                    Tu ai Bars care are 10 elemente, in array este Bars[0..9] nu poti apela elementul 10 cu Bars[10] trebuie sa mai scazi 1.

                    int pos = Bars - counted_bars - 1;
                    //counted_bars = 0

                    http://docs.mql4.com/predefined/high

                    uite si un exemplu la fel.
                    Last edited by iulik; 7th December 2015, 08:40 PM.

                    Comment


                    • In linia 50 se face
                      Code:
                      if (counted_bars > 0) counted_bars--;
                      , deci cred ca conditia e deja satisfacuta.
                      A good trade is when I Break Even. A great trade is when I Take Profit.

                      Comment


                      • uite logul:

                        0 21:46:15.326 test1 EURUSD,H1: initialized
                        0 21:46:15.326 test1 EURUSD,H1: Counted bars = 0
                        0 21:46:15.326 test1 EURUSD,H1: Bars = 5216
                        0 21:46:18.903 test1 EURUSD,H1: Counted bars = 5215
                        0 21:46:18.903 test1 EURUSD,H1: Bars = 5216
                        0 21:46:18.904 test1 EURUSD,M1: Counted bars = 38624
                        0 21:46:18.904 test1 EURUSD,M1: Bars = 38625
                        0 21:46:19.060 test1 EURUSD,H1: Counted bars = 5215
                        0 21:46:19.060 test1 EURUSD,H1: Bars = 5216
                        0 21:46:19.060 test1 EURUSD,M1: Counted bars = 38624
                        0 21:46:19.060 test1 EURUSD,M1: Bars = 38625
                        0 21:46:19.197 test1 EURUSD,H1: Counted bars = 5215
                        0 21:46:19.197 test1 EURUSD,H1: Bars = 5216
                        0 21:46:19.197 test1 EURUSD,M1: Counted bars = 38624
                        0 21:46:19.197 test1 EURUSD,M1: Bars = 38625
                        0 21:46:19.352 test1 EURUSD,H1: Counted bars = 5215

                        te-ai luminat de ce crapa?
                        tot timpul cand initializezi indicatorul, counted_bars = 0
                        si m-am uitat si pe exemple si e la fel.
                        Last edited by iulik; 7th December 2015, 10:00 PM.

                        Comment


                        • Da, asa este. Nu prea intelegeam ce face cu exactitate functia IndicatorCounted().
                          1. Intr-adevar, la initializare numarul barelor care nu s-au moficat este 0.
                          2. Apoi, clar ca nu se putea apela nici array-ul, cu valoarea data de Bars.
                          3. Practic, linia if (counted_bars > 0) counted_bars --; e degeaba. Cu sau fara ea, programelul in varianta pos = Bars - counted_bars -1 ;, functioneaza, lucru care mi se pare foarte curios, deoarece counted_bars -- este echivalent cu counted_bars - 1, exceptand faptul ca counted_bars-- pare a fi local in interiorul lui if, lucru care nu e normal.
                          4. Mi-ai fost de ajutor real cu log-ul. Apropo, de unde il iau si eu ?
                          5. Si mai era o chestie. Eu am pus
                          Code:
                          //#property indicator_maximum 100
                          //#property indicator_minimum 0
                          , cand de fapt valorile uzuale sunt abia la nivelul ultimelor 4 zecimale.
                          Attached Files
                          Last edited by Cornelius; 7th December 2015, 11:13 PM.
                          A good trade is when I Break Even. A great trade is when I Take Profit.

                          Comment


                          • Am vazut ca sunt destul de multe joburi de indicatori / experti pe site-ul celor de la mql5... a incercat cineva sa faca vreunul contra-cost ?
                            A good trade is when I Break Even. A great trade is when I Take Profit.

                            Comment


                            • Print ("Counted bars = ", counted_bars);
                              Print ("Bars = ", Bars);

                              Nu am scris nici un indicator Ón mql4... property.. Nu le am cu dastea. Dacă arde mă uit.

                              Comment


                              • Eu foloseam Comment(), afisam tot timpul ce ma interesa pe ecran.

                                Comment

                                Working...
                                X