fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Problem using old indicator need help on start() vs on calculate()

    Bug Reports
    4
    24
    6869
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Bsalamone last edited by

      Please help, I have looked for hours on end trying to find a simple vwop indicator that is compatible with EA, the one I have and the only one I could find is old version meaning it uses on start() instead of on calculate () and the EA does not work at all, I am looking for some help, I want to make a crossover EA with the vwop and a simple moving average, or maybe someone can explain how to either convert a trading view indicator to mt4 for EA or provide me with a simple mt4 vwop, all of the ones I have found include bands and all sorts of stuff, I simply want a regular one I will include a screen shot from trading view, PLEASE HELP THANK YOU!!!!!

      Brian

      Brian Salamone

      B 1 Reply Last reply Reply Quote 0
      • B
        Bsalamone @Bsalamone last edited by

        @0_1585684328143_28725702-f328-4c14-bf6a-d10464fefd86-image.png bsalamone https://fxdreema.com/forum/assets/uploads/files/1585682171025-ed66be7a-3bdf-4362-a4fe-7d4c2ee7e320-image.png

        Brian Salamone

        1 Reply Last reply Reply Quote 0
        • X
          Xfire last edited by

          HI.
          what is your algorithm? please share your project by menu "creating shared copy"
          do you know how using ex4 file? have you indicator mq4 file?

          IN GOD WE TRUST

          1 Reply Last reply Reply Quote 0
          • B
            Bsalamone last edited by

            It is not created, I don't have a VWOP indicator that is compatible with EA I do have a simple mt4 VWOP indicator that works fine on chart but not in EA, I have the script for that, I just don't know how to convert the old mt4 it is such a simple strategy but I just can't get this indicator in my EA, helpppppppppp thanks!!!

            this is the pine code from tradingview for vwop

            //@version=3
            study("VWAP", overlay=true)

            // There are five steps in calculating VWAP:
            //
            // 1. Calculate the Typical Price for the period. [(High + Low + Close)/3)]
            // 2. Multiply the Typical Price by the period Volume (Typical Price x Volume)
            // 3. Create a Cumulative Total of Typical Price. Cumulative(Typical Price x Volume)
            // 4. Create a Cumulative Total of Volume. Cumulative(Volume)
            // 5. Divide the Cumulative Totals.
            //
            // VWAP = Cumulative(Typical Price x Volume) / Cumulative(Volume)

            cumulativePeriod = input(14, "Period")

            typicalPrice = (high + low + close) / 3
            typicalPriceVolume = typicalPrice * volume
            cumulativeTypicalPriceVolume = sum(typicalPriceVolume, cumulativePeriod)
            cumulativeVolume = sum(volume, cumulativePeriod)
            vwapValue = cumulativeTypicalPriceVolume / cumulativeVolume

            plot(vwapValue)

            Brian Salamone

            1 Reply Last reply Reply Quote 0
            • B
              Bsalamone last edited by

              Important: Custom indicators used in any EA must be programmed in the new MQL4 language. The MQL4 language has changed significantly since build 600 at the beginning of 2014. Old, incompatible indicators include the functions init() and start(), whereas new indicators include the functions OnInit() and OnCalculate().

              Brian Salamone

              X C 2 Replies Last reply Reply Quote 0
              • X
                Xfire @Bsalamone last edited by

                @bsalamone if you have indicator please attach here and i can help you.
                if you haven't correct indicator then programmer users should help you. sorry

                IN GOD WE TRUST

                1 Reply Last reply Reply Quote 0
                • B
                  Bsalamone last edited by

                  //+------------------------------------------------------------------+
                  //| VWAP.mq4 |
                  //| mwfx108 |
                  //| mwfx108@gmail.com |
                  //| Like my stuff? Made some profits using it? |
                  //| Donate ETH @ 0xeDC0D4Dd8abcB106FEdC17Ce07Cc68a6571a038e |
                  //+------------------------------------------------------------------+
                  #property copyright "mwfx108"
                  #property link "mwfx108@gmail.com"
                  #property version "1.00"
                  #property strict
                  #property indicator_buffers 1
                  #property indicator_chart_window
                  #property indicator_color1 Red
                  //+------------------------------------------------------------------+
                  //| Variables |
                  //+------------------------------------------------------------------+
                  double ExtBufferVWAP[];
                  double __ohlcvTotal,
                  __volumeTotal;
                  datetime __sessionStartTime;

                  //+------------------------------------------------------------------+
                  //| Custom indicator initialization function |
                  //+------------------------------------------------------------------+
                  int OnInit()
                  {
                  //---

                  __volumeTotal = 0;
                  __ohlcvTotal = 0;
                  __sessionStartTime = 0;

                  IndicatorShortName( "VWAP" );
                  IndicatorDigits( _Digits );

                  //--- Drawing settings
                  SetIndexStyle( 0, DRAW_LINE );

                  //--- Indicator buffers mapping
                  SetIndexBuffer( 0, ExtBufferVWAP );

                  //---
                  return(INIT_SUCCEEDED);
                  }
                  //+------------------------------------------------------------------+
                  //| Custom indicator iteration function |
                  //+------------------------------------------------------------------+
                  int OnCalculate(const int rates_total,
                  const int prev_calculated,
                  const datetime &time[],
                  const double &open[],
                  const double &high[],
                  const double &low[],
                  const double &close[],
                  const long &tick_volume[],
                  const long &volume[],
                  const int &spread[])
                  {
                  //---

                  // An "Intraday" indicator makes no sense anymore above H1
                  if ( Period() >= PERIOD_H4 )
                  {
                  return ( rates_total - 1 );
                  }

                  int startIndex = MathMax( 0, rates_total - prev_calculated - 1 );

                  // Only calculate up until the previous bar. We don't want to calculate the current bar.
                  if ( startIndex > 0 )
                  {
                  for ( int i = startIndex; i >= 1; i-- )
                  {
                  double
                  ohlcAvg = ( open[ i ] + high[ i ] + low[ i ] + close[ i ] ) / 4,
                  vol = ( double ) tick_volume[ i ];

                       // Reset values when session changed
                       if ( TimeDay( time[ i ] ) != TimeDay ( __sessionStartTime ) )
                       {
                          __sessionStartTime = time[ i ];
                          __ohlcvTotal = 0;
                          __volumeTotal = 0;
                       }
                          
                       __ohlcvTotal += ohlcAvg * vol;
                       __volumeTotal += vol;
                       
                       ExtBufferVWAP[ i ] = NormalizeDouble( __ohlcvTotal / __volumeTotal, _Digits );
                    }
                  

                  }

                  return( rates_total - 1 );
                  }
                  //+------------------------------------------------------------------+

                  Brian Salamone

                  1 Reply Last reply Reply Quote 0
                  • B
                    Bsalamone last edited by

                    1_1585696232682_VWAP.mq4 0_1585696232681_VWAP.ex4

                    Brian Salamone

                    X 1 Reply Last reply Reply Quote 0
                    • X
                      Xfire @Bsalamone last edited by

                      @bsalamone this working perfect in meta4 and then working in Fxdreema. what is exactly your problem?
                      do you know how you should use that?

                      IN GOD WE TRUST

                      1 Reply Last reply Reply Quote 0
                      • B
                        Bsalamone last edited by

                        0_1585696251545_VWAP.mq4

                        Brian Salamone

                        X 1 Reply Last reply Reply Quote 0
                        • X
                          Xfire @Bsalamone last edited by

                          @bsalamone 0_1585698108613_Annotation 2020-02-16 150049.png

                          what do you want to use it?

                          IN GOD WE TRUST

                          B 1 Reply Last reply Reply Quote 0
                          • B
                            Bsalamone @Xfire last edited by

                            @xfire 0_1585705545778_9b025500-1e05-4533-b895-ca9a7b1bbc7c-image.png

                            Brian Salamone

                            X 1 Reply Last reply Reply Quote 0
                            • B
                              Bsalamone last edited by

                              when I run the EA it makes absolutely no trades at all ... I have been trying to figure this out for days so very frustrating

                              Brian Salamone

                              X 1 Reply Last reply Reply Quote 0
                              • X
                                Xfire @Bsalamone last edited by Xfire

                                @bsalamone yes i checked your indicator that has a problem for loaded in EA
                                you should find better version 🙂

                                IN GOD WE TRUST

                                B 1 Reply Last reply Reply Quote 0
                                • X
                                  Xfire @Bsalamone last edited by

                                  @bsalamone 0_1585710504624_vwap.mq5

                                  it is for mt5 you can test your strategy

                                  IN GOD WE TRUST

                                  1 Reply Last reply Reply Quote 0
                                  • l'andorrà
                                    l'andorrà last edited by

                                    Disconnect those 'Close trades' blocks and create an independent tree structure for them.

                                    (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                                    (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                                    (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                                    1 Reply Last reply Reply Quote 0
                                    • B
                                      Bsalamone @Xfire last edited by

                                      @xfire I have been trying to find a better version for days!!! I DONT UNDERSTAND LOL

                                      Brian Salamone

                                      1 Reply Last reply Reply Quote 0
                                      • l'andorrà
                                        l'andorrà last edited by

                                        Did you try Xfire's EA for mq5?

                                        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                                        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                                        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                                        X 1 Reply Last reply Reply Quote 0
                                        • X
                                          Xfire @l'andorrà last edited by

                                          @l-andorrà
                                          No. i will check

                                          IN GOD WE TRUST

                                          l'andorrà 1 Reply Last reply Reply Quote 0
                                          • l'andorrà
                                            l'andorrà @Xfire last edited by

                                            @xfire said in Problem using old indicator need help on start() vs on calculate():

                                            @l-andorrà
                                            No. i will check

                                            My question was for Bsalamone. 🙂

                                            (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                                            (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                                            (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                                            X 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            Online Users

                                            D
                                            E
                                            J
                                            T
                                            J

                                            24
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors