tickSpeedIndicator

0 Views
0 Downloads
0 Favorites
tickSpeedIndicator
#include<Trade\Trade.mqh>
CTrade trade;

int tickCont = 0;    // ticks counter
datetime tempDate = TimeCurrent();
datetime tickSpeed = "0";

void OnTick()
  {

   datetime timeCurrent = TimeCurrent();
   string strTickSpeed = StringSubstr(tickSpeed,14,5);

   if (tickCont == 100)
   {
      tickSpeed = timeCurrent - tempDate;
      tempDate = timeCurrent;
      tickCont = 0;
   }
      
   
   Comment("\nTick Counter: ", tickCont,
           "\nCurrent Time: ", timeCurrent,
           "\nTemporary Time: ", tempDate,
           "\n\nTick Speed (sec/centick):: ", strTickSpeed);
           
   tickCont++;
  }


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 ---