Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
606
Rating:
(2)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

This function gives me the shortened names of the timeframes

Example:

"M1" instead of "PERIOD_M1"


void OnStart()
  {
   ENUM_TIMEFRAMES timeframe = Period();
   string result = GetTimeframeShortName(timeframe);
   Comment(result);
   Print(result);
  }
//+------------------------------------------------------------------+
//| function to get timeframe short name |
//+------------------------------------------------------------------+
string GetTimeframeShortName(const ENUM_TIMEFRAMES timeframe)
  {
    switch(timeframe)
      {
        case PERIOD_M1: return "M1";
        case PERIOD_M2: return "M2";
        case PERIOD_M3: return "M3";
        case PERIOD_M4: return "M4";
        case PERIOD_M5: return "M5";
        case PERIOD_M6: return "M6";
        case PERIOD_M10: return "M10";
        case PERIOD_M12: return "M12";
        case PERIOD_M15: return "M15";
        case PERIOD_M20: return "M20";
        case PERIOD_M30: return "M30";
        case PERIOD_H1: return "H1";
        case PERIOD_H2: return "H2";
        case PERIOD_H3: return "H3";
        case PERIOD_H4: return "H4";
        case PERIOD_H6: return "H6";
        case PERIOD_H8: return "H8";
        case PERIOD_H12: return "H12";
        case PERIOD_D1: return "D1";
        case PERIOD_W1: return "W1";
        case PERIOD_MN1: return "MN1";
        default: return "";
      }
  }

    Translated from Portuguese by MetaQuotes Ltd.
    Original code: https://www.mql5.com/pt/code/43357

    BBMA Oma Ally OmniView BBMA Oma Ally OmniView

    It's like a bird's-eye view for BBMA Oma Ally fans. ust drag it onto the chart and you'll get all the BBMA signals running on the chart.

    RSA Library for asymmetric encryption in MQL5 RSA Library for asymmetric encryption in MQL5

    Securing data transfer between client and Server could be a big challenge for you as MQL5 programmer. You may have experience in using built in MQL5 encryption systems like AES.AES can securely encrypt your data but on the other hand is not secure when it comes to sending the AES key through insecure channels. You can only rely on asymmetric encryption systems Like RSA in such cases. you keep the private key at your server side and only share the public key with your clients. Even more you can use hybrid RSA_AES approach to archive more performance

    Price Channel Price Channel

    This is a simple price channel indicator allowing user to customize period and line colours. Often used in channel break strategies.

    Uniformity Factor Script Uniformity Factor Script

    The script provides a quick estimation of an exponent/power factor for transformation of variable-length price increments into uniform distibution, that makes them a "random walk". The estimated value characterizes current symbol as more profitable when using in a particular trading strategy.