fxDreema

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

    'start' - function can be declared only in the global scope

    Bug Reports
    2
    4
    4703
    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.
    • K
      kingfathom last edited by

      Is anyone else getting this error when exporting?

      **"'start' - function can be declared only in the global scope" **

      it keeps coming up. I'm wondering if its on my end.

      I'm referencing a custom indicator, could this be related?

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        I don't know what you are doing, but in MQL4/MQL5 you can't define function within another function, all functions are on the same level

        1 Reply Last reply Reply Quote 0
        • K
          kingfathom last edited by

          We're trying to export an EA that has a custom indicator in the "My Indicators List"
          Any EA using built in indicators export fine; however any time a condition references our custom indicator (which has exported fine over the past two weeks) it returns this error when trying to export.
          Just in the past two or three days this error has cropped up.

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            Very strange, I see this for the first time. Somehow this appears in the code:

            void iCustom()
            {
            	//---- Read value from trend and signal buffer
            int start()
            {
            // Read values
            double trend  = iCustom(Symbol(), Period(), "PZ_LopezTrend_LICENSENUM", 5, 1);
            double signal = iCustom(Symbol(), Period(), "PZ_LopezTrend_LICENCESUM", 6, 1);
            // Do something
            if(trend  == OP_BUY)      { /* Your code if trend is currently bullish */ }
            if(trend  == OP_SELL)     { /* Your code if trend is currently bearish */ }
            if(signal == OP_BUY)      { /* Your code for bullish trend change */ }
            if(signal == OP_SELL)     { /* Your code for bearish trend change */ }
            // Exit
            return(0);
            }
            	return;
            }
            

            .. but I don't recognize this code and I can't see how it's injected into the code. Do you have some idea?

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

            Online Users

            O
            J
            B
            M

            14
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors