Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
@@ -0,0 +1,20 @@
|
||||
# 🚀 Unlock the Power of Trading!
|
||||
|
||||
Welcome to this open-source trading project. Here you will find powerful tools to enhance your trading journey. If you find this project useful, please consider starring ⭐, sharing, or donating to support further development!
|
||||
|
||||
---
|
||||
|
||||
**Support the project:**
|
||||
- Star this repository on GitHub
|
||||
- Share it with your trading friends
|
||||
- [Donate here](https://www.paypal.com/donate/?hosted_button_id=YOUR_BUTTON_ID) to help us grow!
|
||||
|
||||
---
|
||||

|
||||

|
||||
|
||||
## Source Files
|
||||
- `ratescompressor.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,37 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| RatesCompressor.mq5 |
|
||||
//| Copyright (c) 2020, Marketeer |
|
||||
//| Modified by Dark Ryd3r |
|
||||
//| https://twitter.com/DarkRyd3r |
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
#include <RatesCompressor.mqh>
|
||||
|
||||
#define PRT(A) Print(#A, " ", (A))
|
||||
|
||||
void OnStart()
|
||||
{
|
||||
PRT(sizeof(MqlRates));
|
||||
PRT(sizeof(MqlRatesOHLC));
|
||||
|
||||
// 1-element arrays are used for pretty-printing via ArrayPrint
|
||||
|
||||
MqlRates rates[1];
|
||||
int data = CopyRates(_Symbol,PERIOD_M1,0,1,rates);
|
||||
ArrayPrint(rates);
|
||||
|
||||
|
||||
MqlRatesOHLC rohlc[1];
|
||||
RatesCompressor::compress(rates, rohlc); // array notation
|
||||
// other way for a single tick can be used as well
|
||||
// rohlc[0] = MqlRatesOHLC::compress(rates[0]);
|
||||
ArrayPrint(rohlc);
|
||||
|
||||
MqlRates result[1];
|
||||
result[0] = MqlRatesOHLC::decompress(rohlc[0]); // single tick notation
|
||||
// other way for arrays can be used as well
|
||||
// RatesCompressor::decompress(rohlc, result);
|
||||
|
||||
ArrayPrint(result);
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Reference in New Issue
Block a user