Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
# 🚀 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
|
||||
- `simpletestsuite.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 207 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
+60
@@ -0,0 +1,60 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| MQLUnit |
|
||||
//| Copyright 2021, Niklas Schlimm |
|
||||
//| https://github.com/nschlimm/MQL5Unit |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2021, Niklas Schlimm"
|
||||
#property version "1.00"
|
||||
|
||||
#include "MQLUnitTestLibrary.mqh"
|
||||
|
||||
int m_movingAverageHandle;
|
||||
|
||||
void OnInit() {
|
||||
m_testSuite = ComposeTestsuite();
|
||||
};
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Simple test example on moving average indicator
|
||||
//+------------------------------------------------------------------+
|
||||
CUnitTestSuite* ComposeTestsuite()
|
||||
{
|
||||
CUnitTestSuite* testSuite = new CUnitTestSuite();
|
||||
testSuite.AddSetupFunction(1, Test_Indicators_copyBuffer_setup);
|
||||
testSuite.AddUnitTestFunction(2,Test_Indicators_copyBuffer);
|
||||
testSuite.AddTearDownFunction(3, Test_Indicators_copyBuffer_tearDown);
|
||||
return testSuite;
|
||||
}
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Setup method to initialize indicator
|
||||
//+------------------------------------------------------------------+
|
||||
void Test_Indicators_copyBuffer_setup()
|
||||
{
|
||||
// initialize indicator
|
||||
m_movingAverageHandle=iMA(_Symbol, PERIOD_CURRENT,10,0,MODE_SMA,PRICE_CLOSE);
|
||||
}
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Tear down and remove indicator
|
||||
//+------------------------------------------------------------------+
|
||||
void Test_Indicators_copyBuffer_tearDown()
|
||||
{
|
||||
// remove indicator
|
||||
m_movingAverageHandle=NULL;
|
||||
}
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Test on indicator
|
||||
//+------------------------------------------------------------------+
|
||||
CUnitTestAsserts* Test_Indicators_copyBuffer()
|
||||
{
|
||||
CUnitTestAsserts* ut = new CUnitTestAsserts("Test_Indicators_copyBuffer");
|
||||
double movingAverageData[];
|
||||
CopyBuffer(m_movingAverageHandle,0,1,10,movingAverageData);
|
||||
// check if data is copied to local array
|
||||
ut.IsTrue(__FILE__, __LINE__, movingAverageData[0] > 0);
|
||||
return ut;
|
||||
}
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
Reference in New Issue
Block a user