Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
@@ -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
|
||||
- `stat.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
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.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,45 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| Stat.mq5 |
|
||||
//| Copyright 2014, MetaQuotes Software Corp. |
|
||||
//| http://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Aliaksandr Yemialyanau"
|
||||
#property version "1.00"
|
||||
#property script_show_inputs
|
||||
//--- input parameters
|
||||
input datetime Start_Date=D'2014.08.18';
|
||||
input datetime End_Date=D'2015.08.18';
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
//---
|
||||
double result,profit=0,loss=0;
|
||||
ulong ticket=0,trades=0;
|
||||
|
||||
HistorySelect(Start_Date,End_Date);
|
||||
uint total=HistoryDealsTotal();
|
||||
for(uint i=0;i<total;i++)
|
||||
{
|
||||
if((ticket=HistoryDealGetTicket(i))>0)
|
||||
{
|
||||
if(HistoryDealGetString(ticket,DEAL_SYMBOL)==Symbol())
|
||||
{
|
||||
trades++;
|
||||
result=HistoryDealGetDouble(ticket,DEAL_PROFIT);
|
||||
if(result<0) loss-=result;
|
||||
else profit+=result;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(trades>0)
|
||||
{
|
||||
if(loss>0) Comment("Trades=",trades," Profit=",DoubleToString(profit-loss,2)," PF=",DoubleToString(profit/loss,2));
|
||||
else Comment("Trades=",trades," Profit=",DoubleToString(profit-loss,2)," PF=++");
|
||||
}
|
||||
else Comment("Trades=0");
|
||||
Sleep(60000);
|
||||
Comment("");
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
Reference in New Issue
Block a user