mirror of
https://github.com/rithsila/MT5-EA-Sniper-Strategy.git
synced 2026-08-19 05:38:15 +00:00
Done! On backtesting stage
This commit is contained in:
Binary file not shown.
@@ -20,6 +20,7 @@
|
||||
#include <Indicators/Trend.mqh>
|
||||
#include <Indicators/Oscilators.mqh>
|
||||
CiMA* ma;
|
||||
CiMA* maHT;
|
||||
CiATR* atr;
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -29,10 +30,13 @@ int OnInit()
|
||||
{
|
||||
//---
|
||||
ma = new CiMA();
|
||||
ma.Create(gSymbol, PERIOD_CURRENT, InpPeriods, InpAppliedPrice, InpMethod, PRICE_CLOSE);
|
||||
ma.Create(gSymbol, InpTimeFrame, InpPeriods, InpAppliedPrice, InpMethod, PRICE_CLOSE);
|
||||
|
||||
maHT = new CiMA();
|
||||
maHT.Create(gSymbol, InpHtTimeframe, InpHtPeriods, InpHtAppliedPrice, InpHtMethod, PRICE_CLOSE);
|
||||
|
||||
atr = new CiATR();
|
||||
atr.Create(gSymbol, PERIOD_CURRENT, InpAtrPeriod);
|
||||
atr.Create(gSymbol, InpTimeFrame, InpAtrPeriod);
|
||||
//---
|
||||
return(INIT_SUCCEEDED);
|
||||
}
|
||||
@@ -53,6 +57,8 @@ void OnTick()
|
||||
TimeCurrent(dt);
|
||||
|
||||
SymbolInfoTick(_Symbol,last_tick);
|
||||
|
||||
//isPinBar();
|
||||
|
||||
CheckOperationHours();
|
||||
CheckPreChecks();
|
||||
@@ -64,12 +70,17 @@ void OnTick()
|
||||
atr.Refresh(-1);
|
||||
gAtr = atr.Main(1);
|
||||
|
||||
maHT.Refresh(-1);
|
||||
gHtMa = maHT.Main(1);
|
||||
|
||||
Print("ATR ", gAtr);
|
||||
Comment("gHtMa ", gHtMa);
|
||||
|
||||
if(!gIsPreChecksOk)
|
||||
return;
|
||||
|
||||
Print("Good for trading...");
|
||||
|
||||
getSignal();
|
||||
ExecuteEntry();
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -97,6 +97,11 @@ input int InpPeriods = 21; //Fast periods
|
||||
input ENUM_MA_METHOD InpMethod = MODE_SMA; //Fast method
|
||||
input ENUM_APPLIED_PRICE InpAppliedPrice = PRICE_CLOSE; //Fast price
|
||||
|
||||
input int InpHtPeriods = 21; //Higher TF periods
|
||||
input ENUM_MA_METHOD InpHtMethod = MODE_SMA; //Higher TF method
|
||||
input ENUM_APPLIED_PRICE InpHtAppliedPrice = PRICE_CLOSE; //Higher TF price
|
||||
input ENUM_TIMEFRAMES InpHtTimeframe = PERIOD_CURRENT; //Timeframe
|
||||
|
||||
// Average True Range
|
||||
input int InpAtrPeriod = 14; //ATR period
|
||||
input int InpAtrMultiplier = 3; //ATR multiplier
|
||||
@@ -110,9 +115,13 @@ input int InpNightTradingHourStart=1; //Night Trading Start Hou
|
||||
input int InpNightTradingHourEnd=5; //Night Trading End Hour (Broker Server Hour)
|
||||
input string InpComment = __FILE__; //Default trade comment
|
||||
input int InpMagicNumber = 198901; //Magic Number
|
||||
input ENUM_TIMEFRAMES InpTimeFrame = PERIOD_CURRENT;
|
||||
|
||||
input double InpMinCandleLenght = 25.0; //Min candle length
|
||||
input int InpCandleWickPercent = 75; //Candle wick percent
|
||||
|
||||
string gSymbol = Symbol();
|
||||
double gAtr, gMa;
|
||||
double gAtr, gMa, gHtMa;
|
||||
|
||||
int gTotalSellPositions, gTotalBuyPositions, gTotalPositions;
|
||||
bool gIsOperatingHours=false;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| TradeManager.mqh |
|
||||
//| Copyright 2021, Nkondog Anselme Venceslas |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2021, Nkondog Anselme Venceslas"
|
||||
#property link "https://www.mql5.com"
|
||||
//+------------------------------------------------------------------+
|
||||
//| defines |
|
||||
//+------------------------------------------------------------------+
|
||||
// #define MacrosHello "Hello, world!"
|
||||
// #define MacrosYear 2010
|
||||
//+------------------------------------------------------------------+
|
||||
//| DLL imports |
|
||||
//+------------------------------------------------------------------+
|
||||
// #import "user32.dll"
|
||||
// int SendMessageA(int hWnd,int Msg,int wParam,int lParam);
|
||||
// #import "my_expert.dll"
|
||||
// int ExpertRecalculate(int wParam,int lParam);
|
||||
// #import
|
||||
//+------------------------------------------------------------------+
|
||||
//| EX5 imports |
|
||||
//+------------------------------------------------------------------+
|
||||
// #import "stdlib.ex5"
|
||||
// string ErrorDescription(int error_code);
|
||||
// #import
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user