1
0
Çatalla 0
şundan çatallanmış nique_372/GrapichsByLeo
GrapichsByLeo/Tests/Distribucion.mq5

67 satır
4,4 KiB
MQL5
Ham Kalıcı Bağlantı Normal Görünüm Geçmiş

2025-11-17 17:02:53 -05:00
<EFBFBD><EFBFBD>//+------------------------------------------------------------------+
//| NormalDistribution.mq5 |
//| Copyright 2025, Test Example |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Test Example"
#property strict
#include "..\\Histogram\\Main.mqh"
2025-11-28 07:55:33 -05:00
// https://forge.mql5.io/amrali/Xoshiro256
#include "..\\..\\Xoshiro256\\Xoshiro256.mqh"
2025-11-17 17:02:53 -05:00
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
2025-11-28 07:55:33 -05:00
{
//---
#define DATA_SIZE 5000
#define BINS 30
//--- Crear histograma
CHistogramVertical histograma;
histograma.Initialize(800, 600, "HistogramaNormal", 0, 0, ColorToARGB(clrWhite));
histograma.CreateBitmapLabel(50, 50, COLOR_FORMAT_ARGB_RAW);
//--- T<EFBFBD>tulo y copyright
histograma.TituloDefault(StringFormat("Distribucion Normal - %d Barras", BINS));
histograma.CreateCopyrightDefault("Test");
//--- Generar datos
Xoshiro256 random;
double datos_normales[DATA_SIZE];
for(int i = 0; i < DATA_SIZE; i++)
{
datos_normales[i] = random.RandomNormal();
}
//--- Crear UN SOLO conjunto con bins autom<EFBFBD>ticos
uint clr_barras = ColorToARGB(clrSteelBlue);
histograma.AddConjuntoBarWithBinsDeft("Normal", datos_normales, BINS, clr_barras);
//--- Inicializar lienzo (sin corte)
int x1 = 70;
int y1 = 50;
int x2 = 700;
int y2 = 500;
histograma.InitLienzoBarras(x1, y1, x2, y2, 10, 10, 3);
//--- Ejes (cambian para vertical)
histograma.CreateEjeLine(HIST_LINE_MODE_ABAJO, ColorToARGB(clrBlack), ColorToARGB(clrBlack), 5, 10, 5, 0, 10, "Arial");
histograma.EjeLineGetPointer().HistogramLinePointerGet().CreateTitulo("Frecuencia", ColorToARGB(clrBlack), 25, 12, "Arial");
//--- Redibujar
histograma.Redraw();
//--- Guardar imagen
histograma.SavePicture("distribucion_normal_vertical.png", true);
//--- Esperar
while(!IsStopped())
{
Sleep(1000);
}
}
//+------------------------------------------------------------------+