cm ScreenShot

Author: Copyright 2022, cmillion@narod.ru
Price Data Components
Series array that contains open time of each bar
0 Views
0 Downloads
0 Favorites
cm ScreenShot
ÿþ//+------------------------------------------------------------------+

//|                                                   ScreenShot.mq4 |

//|                                Copyright 2022, cmillion@narod.ru |

//|                                               http://cmillion.ru |

//+------------------------------------------------------------------+

#property copyright "Copyright 2022, cmillion@narod.ru"

#property link      "http://cmillion.ru"

#property version   "1.00"

#property strict

#property indicator_chart_window

#property description "=48:0B>@ 70?8AK205B A:@8=H>B =0 :064>9 A25G5. The indicator records a screenshot on each candle"

extern ENUM_TIMEFRAMES TimeFrame  = 0;

//+------------------------------------------------------------------+

//| =48:0B>@ 70?8AK205B A:@8=H>B =0 :064>9 A25G5

//+------------------------------------------------------------------+

int OnInit()

  {

  return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

datetime TimeScren=0;

//+------------------------------------------------------------------+

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[])

  {

//---

  if (TimeScren!=iTime(NULL,TimeFrame,0))

  {

      TimeScren=iTime(NULL,TimeFrame,0);

      #ifdef __MQL4__

      int TekHour = Hour();

      int Minute  = Minute();

      int Seconds = Seconds();

      

      #endif

   

      #ifdef __MQL5__

      MqlDateTime tm;

      TimeCurrent(tm);

      int TekHour = tm.hour;

      int Minute  = tm.min;

      int Seconds = tm.sec;

      #endif

      string ScreenShotName="Screen"+"//"+TimeToString(TimeCurrent(),TIME_DATE)+(TekHour<10?"0":"")+IntegerToString(TekHour)+"-"+(Minute<10?"0":"")+IntegerToString(Minute)+"-"+(Seconds<10?"0":"")+IntegerToString(Seconds)+".gif";

      int WIDTH=(int)ChartGetInteger(0,CHART_WIDTH_IN_PIXELS);

      int HEIGHT=(int)ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS);

      ChartScreenShot(0,ScreenShotName,WIDTH,HEIGHT,ALIGN_RIGHT);

  }

   

//--- return value of prev_calculated for next call

   return(rates_total);

  }

//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---