Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
@@ -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
|
||||
- `bulls_bears.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
@@ -0,0 +1,34 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| bulls_bears.mq5 |
|
||||
//| Copyright 2015,Viktor Moss |
|
||||
//| https://login.mql5.com/ru/users/vicmos |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2015,Viktor Moss"
|
||||
#property link "https://login.mql5.com/ru/users/vicmos"
|
||||
#property version "1.00"
|
||||
#property script_show_inputs
|
||||
|
||||
input int NumCandles=1000;
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
//---
|
||||
int bulls=0,bears=0;
|
||||
double op[],cl[];
|
||||
int sp[];
|
||||
if(CopyOpen(_Symbol,PERIOD_CURRENT,0,NumCandles,op)<0) return;
|
||||
if(CopyClose(_Symbol,PERIOD_CURRENT,0,NumCandles,cl)<0) return;
|
||||
if(CopySpread(_Symbol,PERIOD_CURRENT,0,NumCandles,sp)<0) return;
|
||||
for(int i=0; i<NumCandles; i++)
|
||||
{
|
||||
if(cl[i]-op[i]>sp[i]*_Point) bulls++;
|
||||
if(op[i]-cl[i]>sp[i]*_Point) bears++;
|
||||
}
|
||||
MessageBox(_Symbol+" "+StringSubstr(EnumToString(_Period),7)+"\n"+
|
||||
"Candles "+IntegerToString(NumCandles)+"\n"+
|
||||
"Bulls "+IntegerToString(bulls)+"\n"+
|
||||
"Bears "+IntegerToString(bears));
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 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.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Reference in New Issue
Block a user