MQL5Book/Scripts/p7/NetFtp.mq5
super.admin 1c8e83ce31 convert
2025-05-30 16:09:41 +02:00

20 lines
1 KiB
MQL5

//+------------------------------------------------------------------+
//| NetFtp.mq5 |
//| Copyright 2022, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#include "..\..\Include\PRTF.mqh"
#include "..\..\Include\Periods.mqh"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
const string filename = _Symbol + "-" + PeriodToString() + "-"
+ (string)(ulong)TimeTradeServer() + ".png";
PRTF(ChartScreenShot(0, filename, 300, 200));
Print("Sending file: " + filename);
PRTF(SendFTP(filename, "/upload")); // 0 or FTP_CONNECT_FAILED(4522), FTP_CHANGEDIR(4523), etc
}
//+------------------------------------------------------------------+