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
|
||||
- `sct_anti-martingale.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 7.2 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 |
+48
@@ -0,0 +1,48 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| SCT_Anti-Martingale.mq5 |
|
||||
//| Copyright 2018, Mario Gharib. |
|
||||
//| mario.gharib@hotmail.com |
|
||||
//+------------------------------------------------------------------+
|
||||
//|IMPORTANT INFORMATION YOU NEED TO KNOW |
|
||||
//+------------------------------------------------------------------+
|
||||
//|Please note that investing involves risks. Any decision to invest |
|
||||
//|in either the real estate or stock markets is a personal decision |
|
||||
//|that should be made after thorough research, including an |
|
||||
//|assessment of your personal risk tolerance and your personal |
|
||||
//|financial condition and goals. Results are based on market |
|
||||
//|conditions and on each individual and the action they take and the|
|
||||
//|time and effort they put in. |
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
#property copyright "Copyright 2020, Mario Gharib. mario.gharib@hotmail.com"
|
||||
#property link "https://www.mql5.com"
|
||||
#property version "1.00"
|
||||
#property script_show_inputs
|
||||
|
||||
#include <Trade/Trade.mqh>
|
||||
CTrade trade;
|
||||
|
||||
input int iNbStopOrders; // Number of stop orders (Buy Stop Or Sell Stop)
|
||||
input double dEntryPrice; // The initial entry price
|
||||
input double dStopPrice; // The initial stop Price
|
||||
input double dLotSize=0.01; // The position size of each trade.
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
string sSymbol = Symbol();
|
||||
|
||||
if (dEntryPrice>SymbolInfoDouble(sSymbol,SYMBOL_ASK)) {
|
||||
double dGrid=dEntryPrice-dStopPrice;
|
||||
for (int i=1 ; i<=iNbStopOrders ; i++)
|
||||
trade.BuyStop(dLotSize,dEntryPrice+(i-1)*dGrid,sSymbol,dEntryPrice+(i-1)*dGrid-dGrid,dEntryPrice+(i-1)*dGrid+2*dGrid);
|
||||
}
|
||||
else {
|
||||
double dGrid=dStopPrice-dEntryPrice;
|
||||
for (int i=1 ; i<=iNbStopOrders ; i++)
|
||||
trade.SellStop(dLotSize,dEntryPrice-(i-1)*dGrid,sSymbol,dEntryPrice-(i-1)*dGrid+dGrid,dEntryPrice-(i-1)*dGrid-2*dGrid);
|
||||
}
|
||||
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
Reference in New Issue
Block a user