Orders Execution
Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
Profitability Reports
GBP/USD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
Multi MA New Sappie V1.35
//+------------------------------------------------------------------+
//| IF YOU FIND THIS EA USEFULL, PLEASE SEND ME $20 WITH PAYPAL |
//| |
//| |
//| In no event will author be liable for any damages whatsoever. |
//| Use at your own risk. |
//| |
//+------------------- DO NOT REMOVE THIS HEADER --------------------+
#define SIGNAL_NONE 0
#define SIGNAL_BUY 1
#define SIGNAL_SELL 2
#define SIGNAL_CLOSEBUY 3
#define SIGNAL_CLOSESELL 4
#property copyright "DocChiro"
#property link "email: rbruckner@gmail.com" // for paypal payment
//extern string s1="TIME TO WAIT IN SECONDS";
//extern int TimeSpan=10;
//extern string s2="-----------------------";
//| IF YOU FIND THIS EA USEFULL, PLEASE SEND ME $20 WITH PAYPAL | **********************
// ea working , just play with settings to find optimal settings
extern double Lots = 0.01;
extern bool UseMovingAverage = true; // TRUE THEN USE EMA 1 CROSS OVER EMA 2
extern bool UseHAS = true; // TRUE THEN USE HEIKEN ASHI
extern bool VoltInd = true; // true then use volty indicator
extern string TrueFalse = "Value of 1 = True, 2 = False";
extern int digiOpMaUseM1 = 1; // use of Moving Average timeframe to open trade
extern int digiOpMaUseM5 = 1; // 1 == true 0 == false
extern int digiOpMaUseM15 = 1;
extern int digiOpMaUseM30 = 1;
extern int digiOpMaUseH1 = 1;
extern int digiOpMaUseH4 = 1;
extern int digiClMaUseM1 = 1; // use of Moving Average timeframe to close trade
extern int digiClMaUseM5 = 1;
extern int digiClMaUseM15 = 1;
extern int digiClMaUseM30 = 1;
extern int digiClMaUseH1 = 1;
extern int digiClMaUseH4 = 1;
extern int digiOpHASUseM1 = 1; // use of HAS to open trade
extern int digiOpHASUseM5 = 1;
extern int digiOpHASUseM15 = 1;
extern int digiOpHASUseM30 = 1;
extern int digiOpHASUseH1 = 1;
extern int digiOpHASUseH4 = 1;
extern int digiClHASUseM1 = 1; // generals use of HAS to close trade
extern int digiClHASUseM5 = 1;
extern int digiClHASUseM15 = 1;
extern int digiClHASUseM30 = 1;
extern int digiClHASUseH1 = 1;
extern int digiClHASUseH4 = 1;
extern int digiOpVoltUseM1 = 1; // use of Volt to open trade
extern int digiOpVoltUseM5 = 1;
extern int digiOpVoltUseM15 = 1;
extern int digiOpVoltUseM30 = 1;
extern int digiOpVoltUseH1 = 1;
extern int digiOpVoltUseH4 = 1;
extern int digiClVoltUseM1 = 1; // use of volt to close trade
extern int digiClVoltUseM5 = 1;
extern int digiClVoltUseM15 = 1;
extern int digiClVoltUseM30 = 1;
extern int digiClVoltUseH1 = 1;
extern int digiClVoltUseH4 = 1;
extern int MagicNumber = 12345;
extern bool SignalMail = False;
extern bool EachTickMode = true;
extern int Slippage = 3;
extern bool UseStopLoss = False;
extern int StopLoss = 30;
extern bool UseTakeProfit = false;
extern int TakeProfit = 50;
extern bool UseTrailingStop = False;
extern int TrailingStop = 30;
extern string FirstMA_Setting = "---------- First MA Setting";
extern int Ma1Period = 12; // SmoMa is for the midline MA, use it to have a midline with two MA/s to cross
extern int MA1Type = 1; //0:SMA 1:EMA 2:SMMA 3:LWMA df 80
extern int MA1Price = 0; //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted
extern int MA1shift = 0;
extern string SecontMA_Setting = "---------- Second MA Setting";
extern int Ma2Period = 21; // SmoMa is for the midline MA, use it to have a midline with two MA/s to cross
extern int MA2Type = 1; //0:SMA 1:EMA 2:SMMA 3:LWMA df 80
extern int MA2Price = 0; //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted
extern int MA2shift = 0;
extern string ThirdMA_Setting = "---------- Third MA Setting, Not Currently being utilised";
extern int Ma3Period = 20; // SmoMa is for the midline MA, use it to have a midline with two MA/s to cross
extern int MA3Type = 0; //0:SMA 1:EMA 2:SMMA 3:LWMA df 80
extern int MA3Price = 0; //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted
extern int MA3shift = 0;
static int TimeFrame = 0;
extern int MaMetod =2;
extern int MaPeriod =6;
extern int MaMetod2 =3;
extern int MaPeriod2 =2;
bool OpMaUseM1; // use of Moving Average timeframe to open trade
bool OpMaUseM5;
bool OpMaUseM15;
bool OpMaUseM30;
bool OpMaUseH1;
bool OpMaUseH4;
bool ClMaUseM1; // use of Moving Average timeframe to close trade
bool ClMaUseM5;
bool ClMaUseM15;
bool ClMaUseM30;
bool ClMaUseH1;
bool ClMaUseH4;
bool OpHASUseM1; // use of HAS to open trade
bool OpHASUseM5;
bool OpHASUseM15;
bool OpHASUseM30;
bool OpHASUseH1;
bool OpHASUseH4;
bool ClHASUseM1; // generals use of HAS to close trade
bool ClHASUseM5;
bool ClHASUseM15;
bool ClHASUseM30;
bool ClHASUseH1;
bool ClHASUseH4;
bool OpVoltUseM1; // use of Volt to open trade
bool OpVoltUseM5;
bool OpVoltUseM15;
bool OpVoltUseM30;
bool OpVoltUseH1;
bool OpVoltUseH4;
bool ClVoltUseM1; // use of volt to close trade
bool ClVoltUseM5;
bool ClVoltUseM15;
bool ClVoltUseM30;
bool ClVoltUseH1;
bool ClVoltUseH4;
int nTicket;
double Ma1M1;
double Ma2M1;
double Ma3M1;
double Ma1M5;
double Ma2M5;
double Ma3M5;
double Ma1M15;
double Ma2M15;
double Ma3M15;
double Ma1M30;
double Ma2M30;
double Ma3M30;
double Ma1H1;
double Ma2H1;
double Ma3H1;
double Ma1H4;
double Ma2H4;
double Ma3H4;
double haOpenM1;
double haCloseM1;
double haOpenM1B;
double haCloseM1B;
double haOpenM5;
double haCloseM5;
double haOpenM5B;
double haCloseM5B;
double haOpenM15;
double haCloseM15;
double haOpenM15B;
double haCloseM15B;
double haOpenM30;
double haCloseM30;
double haOpenM30B;
double haCloseM30B;
double haOpenH1;
double haCloseH1;
double haOpenH1B;
double haCloseH1B;
double haOpenH4;
double haCloseH4;
double haOpenH4B;
double haCloseH4B;
double Volt1M1;
double Volt2M1;
double Volt1M5;
double Volt2M5;
double Volt1M15;
double Volt2M15;
double Volt1M30;
double Volt2M30;
double Volt1H1;
double Volt2H1;
double Volt1H4;
double Volt2H4;
string VoltSigM1;
string VoltSigM5;
string VoltSigM15;
string VoltSigM30;
string VoltSigH1;
string VoltSigH4;
string VText;
color VColor;
string MaText;
color MaColor;
string HASText;
color HASColor;
double LowerBarA; // for MTF HAS BAR on chart
double LowerBarB;
double PM1 = PERIOD_M1;
double PM5 = PERIOD_M5;
double PM15 = PERIOD_M15;
double PM30 = PERIOD_M30;
double PH1 = PERIOD_H1;
double PH4 = PERIOD_H4;
string LastTrade ="";
bool M1Buy = false;
bool M1Sell = false;
bool M5Buy = false;
bool M5Sell = false;
bool M15Buy = false;
bool M15Sell = false;
bool M30Buy = false;
bool M30Sell = false;
bool H1Buy = false;
bool H1Sell = false;
bool H4Buy = false;
bool H4Sell = false;
bool AllSell = false;
bool AllBuy = false;
bool CloseBuy = false;
bool CloseSell = false;
bool VoltAllSell = false;
bool VoltAllBuy = false;
bool VoltCloseBuy = false;
bool VoltCloseSell = false;
bool MaM1Buy = false;
bool MaM1Sell = false;
bool MaM5Buy = false;
bool MaM5Sell = false;
bool MaM15Buy = false;
bool MaM15Sell = false;
bool MaM30Buy = false;
bool MaM30Sell = false;
bool MaH1Buy = false;
bool MaH1Sell = false;
bool MaH4Buy = false;
bool MaH4Sell = false;
bool MaAllSell = false;
bool MaAllBuy = false;
bool MaCloseBuy = false;
bool MaCloseSell= false;
string MaSigM1 = "";
string MaSigM5 = "";
string MaSigM15 = "";
string MaSigM30 = "";
string MaSigH1 = "";
string MaSigH4 = "";
string HASSigM1 = "";
string HASSigM5 = "";
string HASSigM15 = "";
string HASSigM30 = "";
string HASSigH1 = "";
string HASSigH4 = "";
string OpSigMaM1Sell = "";
string OpSigMaM5Sell = "";
string OpSigMaM15Sell = "";
string OpSigMaM30Sell = "";
string OpSigMaH1Sell = "";
string OpSigMaH4Sell = "";
string OpSigMaM1Buy = "";
string OpSigMaM5Buy = "";
string OpSigMaM15Buy = "";
string OpSigMaM30Buy = "";
string OpSigMaH1Buy = "";
string OpSigMaH4Buy = "";
string OpSigVoltM1Sell = "";
string OpSigVoltM5Sell = "";
string OpSigVoltM15Sell = "";
string OpSigVoltM30Sell = "";
string OpSigVoltH1Sell = "";
string OpSigVoltH4Sell = "";
string OpSigVoltM1Buy = "";
string OpSigVoltM5Buy = "";
string OpSigVoltM15Buy = "";
string OpSigVoltM30Buy = "";
string OpSigVoltH1Buy = "";
string OpSigVoltH4Buy = "";
string OpSigHASM1Sell = "";
string OpSigHASM5Sell = "";
string OpSigHASM15Sell = "";
string OpSigHASM30Sell = "";
string OpSigHASH1Sell = "";
string OpSigHASH4Sell = "";
string OpSigHASM1Buy = "";
string OpSigHASM5Buy = "";
string OpSigHASM15Buy = "";
string OpSigHASM30Buy = "";
string OpSigHASH1Buy = "";
string OpSigHASH4Buy = "";
string ClM1HASSig = "";
string ClM5HASSig = "";
string ClM15HASSig = "";
string ClM30HASSig = "";
string ClH1HASSig = "";
string ClH4HASSig = "";
string ClM1MaSig = "";
string ClM5MaSig = "";
string ClM15MaSig = "";
string ClM30MaSig = "";
string ClH1MaSig = "";
string ClH4MaSig = "";
string ClM1VoltSig = "";
string ClM5VoltSig = "";
string ClM15VoltSig = "";
string ClM30VoltSig = "";
string ClH1VoltSig = "";
string ClH4VoltSig = "";
bool FinCloseBuy = false;
bool FinCloseSell = false;
bool FinBuy = false;
bool FinSell = false;
string b=""; // b for buy (ie if last was sell then buy is 1, else if last buy then b=2
string s="";
string d=""; // d for default if tiem frame not selected
int LTicket = 0;
int Total, Ticket;
int BarCount;
int Current;
bool TickCheck = False;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init() {
BarCount = Bars;
MagicNumber = subGenerateMagicNumber(MagicNumber, Symbol(), Period());
if (EachTickMode) Current = 0; else Current = 1;
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit() {
return(0);
}
datetime CandleTime=0;
int nTrend=0;
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start() {
int Order = SIGNAL_NONE;
int Total, Ticket;
double StopLossLevel, TakeProfitLevel;
// calls up lower bars MTF HAS onto CHART_BAR MTF HAS Bar Lower A
LowerBarA = iCustom(NULL,PM5,"MTF HAS Bar Lower A",0,0);
//LowerBarB = iCustom(NULL,PM5,"MTF HAS Bar Lower B",0,0);
//assigns values
if (digiOpMaUseM1 == 1) OpMaUseM1 = true; // use of Moving Average timeframe to open trade
if (digiOpMaUseM5 == 1) OpMaUseM5 = true; // 1 == true 2 == false
if (digiOpMaUseM15 == 1)OpMaUseM15 = true;
if (digiOpMaUseM30 == 1)OpMaUseM30 = true;
if (digiOpMaUseH1 == 1) OpMaUseH1 = true;
if (digiOpMaUseH4 == 1) OpMaUseH4 = true;
if (digiClMaUseM1 == 1) ClMaUseM1 = true; // use of Moving Average timeframe to close trade
if (digiClMaUseM5 == 1) ClMaUseM5 = true;
if (digiClMaUseM15 == 1)ClMaUseM15 = true;
if (digiClMaUseM30 == 1)ClMaUseM30 = true;
if (digiClMaUseH1 == 1) ClMaUseH1 = true;
if (digiClMaUseH4 == 1) ClMaUseH4 = true;
if (digiOpHASUseM1 == 1) OpHASUseM1 = true; // use of HAS to open trade
if (digiOpHASUseM5 == 1) OpHASUseM5 = true;
if (digiOpHASUseM15 == 1)OpHASUseM15 = true;
if (digiOpHASUseM30 == 1)OpHASUseM30 = true;
if (digiOpHASUseH1 == 1) OpHASUseH1 = true;
if (digiOpHASUseH4 == 1) OpHASUseH4 = true;
if (digiClHASUseM1 == 1) ClHASUseM1 = true; // generals use of HAS to close trade
if (digiClHASUseM5 == 1) ClHASUseM5 = true;
if (digiClHASUseM15 == 1)ClHASUseM15 = true;
if (digiClHASUseM30 == 1)ClHASUseM30 = true;
if (digiClHASUseH1 == 1) ClHASUseH1 = true;
if (digiClHASUseH4 == 1) ClHASUseH4 = true;
if (digiOpVoltUseM1 == 1) OpVoltUseM1 = true; // use of Volt to open trade
if (digiOpVoltUseM5 == 1) OpVoltUseM5 = true;
if (digiOpVoltUseM15 == 1)OpVoltUseM15 = true;
if (digiOpVoltUseM30 == 1)OpVoltUseM30 = true;
if (digiOpVoltUseH1 == 1) OpVoltUseH1 = true;
if (digiOpVoltUseH4 == 1) OpVoltUseH4 = true;
if (digiClVoltUseM1 == 1) ClVoltUseM1 = true; // use of volt to close trade
if (digiClVoltUseM5 == 1) ClVoltUseM5 = true;
if (digiClVoltUseM15 == 1)ClVoltUseM15 = true;
if (digiClVoltUseM30 == 1)ClVoltUseM30 = true;
if (digiClVoltUseH1 == 1) ClVoltUseH1 = true;
if (digiClVoltUseH4 == 1) ClVoltUseH4 = true;
if (digiOpMaUseM1 == 2) OpMaUseM1 = false; // use of Moving Average timeframe to open trade
if (digiOpMaUseM5 == 2) OpMaUseM5 = false; // 1 == true 2 == false
if (digiOpMaUseM15 == 2)OpMaUseM15 = false;
if (digiOpMaUseM30 == 2)OpMaUseM30 = false;
if (digiOpMaUseH1 == 2) OpMaUseH1 = false;
if (digiOpMaUseH4 == 2) OpMaUseH4 = false;
if (digiClMaUseM1 == 2) ClMaUseM1 = false; // use of Moving Average timeframe to close trade
if (digiClMaUseM5 == 2) ClMaUseM5 = false;
if (digiClMaUseM15 == 2)ClMaUseM15 = false;
if (digiClMaUseM30 == 2)ClMaUseM30 = false;
if (digiClMaUseH1 == 2) ClMaUseH1 = false;
if (digiClMaUseH4 == 2) ClMaUseH4 = false;
if (digiOpHASUseM1 == 2) OpHASUseM1 = false; // use of HAS to open trade
if (digiOpHASUseM5 == 2) OpHASUseM5 = false;
if (digiOpHASUseM15 == 2)OpHASUseM15 = false;
if (digiOpHASUseM30 == 2)OpHASUseM30 = false;
if (digiOpHASUseH1 == 2) OpHASUseH1 = false;
if (digiOpHASUseH4 == 2) OpHASUseH4 = false;
if (digiClHASUseM1 == 2) ClHASUseM1 = false; // generals use of HAS to close trade
if (digiClHASUseM5 == 2) ClHASUseM5 = false;
if (digiClHASUseM15 == 2)ClHASUseM15 = false;
if (digiClHASUseM30 == 2)ClHASUseM30 = false;
if (digiClHASUseH1 == 2) ClHASUseH1 = false;
if (digiClHASUseH4 == 2) ClHASUseH4 = false;
if (digiOpVoltUseM1 == 2) OpVoltUseM1 = false; // use of Volt to open trade
if (digiOpVoltUseM5 == 2) OpVoltUseM5 = false;
if (digiOpVoltUseM15 == 2)OpVoltUseM15 = false;
if (digiOpVoltUseM30 == 2)OpVoltUseM30 = false;
if (digiOpVoltUseH1 == 2) OpVoltUseH1 = false;
if (digiOpVoltUseH4 == 2) OpVoltUseH4 = false;
if (digiClVoltUseM1 == 2) ClVoltUseM1 = false; // use of volt to close trade
if (digiClVoltUseM5 == 2) ClVoltUseM5 = false;
if (digiClVoltUseM15 == 2)ClVoltUseM15 = false;
if (digiClVoltUseM30 == 2)ClVoltUseM30 = false;
if (digiClVoltUseH1 == 2) ClVoltUseH1 = false;
if (digiClVoltUseH4 == 2) ClVoltUseH4 = false;
if (EachTickMode && Bars != BarCount) TickCheck = False;
Total = OrdersTotal();
Order = SIGNAL_NONE;
//+------------------------------------------------------------------+
//| Variable Begin |
//+------------------------------------------------------------------+
OutputLabelToChart(1 ,1,10,RoyalBlue,"" ,"*");
OutputLabelToChart(1 ,1,10,Red,"" ,"*");
//+------------------------------------------------------------------+
//| Variable End |
//+------------------------------------------------------------------+
// close buy/sell for Ma / HAS & Volty irrespective of the selection made, done as standard
if(LastTrade == "Buy" || LastTrade == "Sell")
{
if (LastTrade == "Sell" )
{
b="1"; // b for buy (ie if last was sell then buy is 1, else if last buy then b=2
s="2";
d="3"; // d for default if tiem frame not selected
}
if (LastTrade == "Buy")
{
b="2"; // b for buy (ie if last was sell then buy is 1, else if last buy then b=2
s="1";
d="3"; // d for default if tiem frame not selected
}
// for M1 timeframe
// FOR MA
if (ClMaUseM1==true)
{
if(MaSigM1 == b) // b for buy (ie if last was sell then buy is 1, else if last buy then b=2
ClM1MaSig = b; // b for buy (ie if last was sell then buy is 1, else if last buy then b=2
else
ClM1MaSig = s; // d for default if tiem frame not selected
}
if (ClMaUseM1==false)
ClM1MaSig = d;
// FOR HAS
if (ClHASUseM1==true)
{
if(HASSigM1 == b)
ClM1HASSig = b;
else
ClM1HASSig = s;
}
if (ClHASUseM1==false)
ClM1HASSig = d;
// FOR VOLTY
if (ClVoltUseM1==true)
{
if(VoltSigM1 == b)
ClM1VoltSig = b;
else
ClM1VoltSig = s;
}
if (ClVoltUseM1==false)
ClM1VoltSig = d;
// for m5 timeframe
// FOR MA
if (ClMaUseM5==true)
{
if(MaSigM5 == b)
ClM5MaSig = b;
else
ClM5MaSig = s;
}
if (ClMaUseM5==false)
ClM5MaSig = d;
// FOR HAS
if (ClHASUseM5==true)
{
if(HASSigM5 == b)
ClM5HASSig = b;
else
ClM5HASSig = s;
}
if (ClHASUseM5==false)
ClM5HASSig = d;
// FOR VOLTY
if (ClVoltUseM5==true)
{
if(VoltSigM5 == b)
ClM5VoltSig = b;
else
ClM5VoltSig = s;
}
if (ClVoltUseM5==false)
ClM5VoltSig = d;
// for M15 time frame
// FOR MA
if (ClMaUseM15==true)
{
if(MaSigM15 == b)
ClM15MaSig = b;
else
ClM15MaSig = s;
}
if (ClMaUseM15==false)
ClM15MaSig = d;
// FOR HAS
if (ClHASUseM15==true)
{
if(HASSigM15 == b)
ClM15HASSig = b;
else
ClM15HASSig = s;
}
if (ClHASUseM15==false)
ClM15HASSig = d;
// FOR VOLTY
if (ClVoltUseM15==true)
{
if(VoltSigM15 == b)
ClM15VoltSig = b;
else
ClM15VoltSig = s;
}
if (ClVoltUseM15==false)
ClM15VoltSig = d;
// for M30 time frame
// FOR MA
if (ClMaUseM30==true)
{
if(MaSigM30 == b)
ClM30MaSig = b;
else
ClM30MaSig = s;
}
if (ClMaUseM30==false)
ClM30MaSig = d;
// FOR HAS
if (ClHASUseM30==true)
{
if(HASSigM30 == b)
ClM30HASSig = b;
else
ClM30HASSig = s;
}
if (ClHASUseM30==false)
ClM30HASSig = d;
// FOR VOLTY
if (ClVoltUseM30==true)
{
if(VoltSigM30 == b)
ClM30VoltSig = b;
else
ClM30VoltSig = s;
}
if (ClVoltUseM30==false)
ClM30VoltSig = d;
// for H1 time frame
// FOR MA
if (ClMaUseH1==true)
{
if(MaSigH1 == b)
ClH1MaSig = b;
else
ClH1MaSig = s;
}
if (ClMaUseH1==false)
ClH1MaSig = d;
// FOR HAS
if (ClHASUseH1==true)
{
if(HASSigH1 == b)
ClH1HASSig = b;
else
ClH1HASSig = s;
}
if (ClHASUseH1==false)
ClH1HASSig = d;
// FOR VOLTY
if (ClVoltUseH1==true)
{
if(VoltSigH1 == b)
ClH1VoltSig = b;
else
ClH1VoltSig = s;
}
if (ClVoltUseH1==false)
ClH1VoltSig = d;
// for H4 time frame
// FOR MA
if (ClMaUseH4==true)
{
if(MaSigH4 == b)
ClH4MaSig = b;
else
ClH4MaSig = s;
}
if (ClMaUseH4==false)
ClH4MaSig = d;
// FOR HAS
if (ClHASUseH4==true)
{
if(HASSigH4 == b)
ClH4HASSig = b;
else
ClH4HASSig = s;
}
if (ClHASUseH4==false)
ClH4HASSig = d;
// FOR VOLTY
if (ClVoltUseH4==true)
{
if(VoltSigH4 == b)
ClH4VoltSig = b;
else
ClH4VoltSig = s;
}
if (ClVoltUseH4==false)
ClH4VoltSig = d;
/// *****************************************************change back to if ==2 then false
if (
(ClH4MaSig == b || ClH4MaSig == d)
&&
(ClH1MaSig == b || ClH1MaSig == d)
&&
(ClM30MaSig == b || ClM30MaSig == d)
&&
(ClM15MaSig == b || ClM15MaSig == d)
&&
(ClM5MaSig == b || ClM5MaSig == d)
&&
(ClM1MaSig == b || ClM1MaSig == d)
)
{
if (LastTrade == "Sell")
{
MaCloseBuy = false;
MaAllBuy=false;
MaAllSell=false;
MaCloseSell = true;
}
if (LastTrade == "Buy")
{
MaCloseBuy = true;
MaAllBuy=false;
MaAllSell=false;
MaCloseSell = false;
}
if (
(ClH4MaSig == s)
||
(ClH1MaSig == s)
||
(ClM30MaSig == s)
||
(ClM15MaSig == s)
||
(ClM5MaSig == s)
||
(ClM1MaSig == s)
)
{
MaCloseSell = false;
MaCloseBuy = false;
MaAllBuy=false;
MaAllSell=false;
}
}
// FOR HAS
if (
(ClH4HASSig == b || ClH4HASSig == d)
&&
(ClH1HASSig == b || ClH1HASSig == d)
&&
(ClM30HASSig == b || ClM30HASSig == d)
&&
(ClM15HASSig == b || ClM15HASSig == d)
&&
(ClM5HASSig == b || ClM5HASSig == d)
&&
(ClM1HASSig == b || ClM1HASSig == d)
)
{
if (LastTrade == "Sell")
{
CloseBuy = false;
AllBuy=false;
AllSell=false;
CloseSell = true;
}
if (LastTrade == "Buy")
{
CloseBuy = true;
AllBuy=false;
AllSell=false;
CloseSell = false;
}
}
if (
(ClH4HASSig == s)
||
(ClH1HASSig == s)
||
(ClM30HASSig == s)
||
(ClM15HASSig == s)
||
(ClM5HASSig == s)
||
(ClM1HASSig == s)
)
{
CloseSell = false;
CloseBuy = false;
AllBuy=false;
AllSell=false;
}
//FOR VOLTY
if (
(ClH4VoltSig == b || ClH4VoltSig == d)
&&
(ClH1VoltSig == b || ClH1VoltSig == d)
&&
(ClM30VoltSig == b || ClM30VoltSig == d)
&&
(ClM15VoltSig == b || ClM15VoltSig == d)
&&
(ClM5VoltSig == b || ClM5VoltSig == d)
&&
(ClM1VoltSig == b || ClM1VoltSig == d)
)
{
if (LastTrade == "Sell")
{
VoltCloseBuy = false;
VoltAllBuy=false;
VoltAllSell=false;
VoltCloseSell = true;
}
if (LastTrade == "Buy")
{
VoltCloseBuy = true;
VoltAllBuy=false;
VoltAllSell=false;
VoltCloseSell = false;
}
}
if (
(ClH4VoltSig == s)
||
(ClH1VoltSig == s)
||
(ClM30VoltSig == s)
||
(ClM15VoltSig == s)
||
(ClM5VoltSig == s)
||
(ClM1VoltSig == s)
)
{
VoltCloseSell = false;
VoltCloseBuy = false;
VoltAllBuy=false;
VoltAllSell=false;
}
}
// end of closing order for all MA / HAS/ Volty
bool IsTrade = False;
double SpreadInfo = iCustom(Symbol(),TimeFrame,"#Signal_Bars_info",0,0);
if (EachTickMode && Bars != BarCount) TickCheck = False;
Total = OrdersTotal();
Order = SIGNAL_NONE;
RefreshRates();
if (AllBuy ==false || AllSell ==false || MaAllSell==false || MaAllBuy == false)
{
}
//Check positions for ma
Ma1M1 = iMA(NULL,PM1,Ma1Period,MA1shift,MA1Type,MA1Price,0);
Ma2M1 = iMA(NULL,PM1,Ma2Period,MA2shift,MA2Type,MA2Price,0);
Ma3M1 = iMA(NULL,PM1,Ma3Period,MA3shift,MA3Type,MA3Price,0);
Ma1M5 = iMA(NULL,PM5,Ma1Period,MA1shift,MA1Type,MA1Price,0);
Ma2M5 = iMA(NULL,PM5,Ma2Period,MA2shift,MA2Type,MA2Price,0);
Ma3M5 = iMA(NULL,PM5,Ma3Period,MA3shift,MA3Type,MA3Price,0);
Ma1M15 = iMA(NULL,PM15,Ma1Period,MA1shift,MA1Type,MA1Price,0);
Ma2M15 = iMA(NULL,PM15,Ma2Period,MA2shift,MA2Type,MA2Price,0);
Ma3M15 = iMA(NULL,PM15,Ma3Period,MA3shift,MA3Type,MA3Price,0);
Ma1M30 = iMA(NULL,PM30,Ma1Period,MA1shift,MA1Type,MA1Price,0);
Ma2M30 = iMA(NULL,PM30,Ma2Period,MA2shift,MA2Type,MA2Price,0);
Ma3M30 = iMA(NULL,PM30,Ma3Period,MA3shift,MA3Type,MA3Price,0);
Ma1H1 = iMA(NULL,PH1,Ma1Period,MA1shift,MA1Type,MA1Price,0);
Ma2H1 = iMA(NULL,PH1,Ma2Period,MA2shift,MA2Type,MA2Price,0);
Ma3H1 = iMA(NULL,PH1,Ma3Period,MA3shift,MA3Type,MA3Price,0);
Ma1H4 = iMA(NULL,PH4,Ma1Period,MA1shift,MA1Type,MA1Price,0);
Ma2H4 = iMA(NULL,PH4,Ma2Period,MA2shift,MA2Type,MA2Price,0);
Ma3H4 = iMA(NULL,PH4,Ma3Period,MA3shift,MA3Type,MA3Price,0);
//Check positions for HAS
haOpenM1 =iCustom(NULL,PM1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
haCloseM1 =iCustom(NULL,PM1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,0);
haOpenM1B =iCustom(NULL,PM1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,1,0);
haCloseM1B =iCustom(NULL,PM1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,0,0);
haOpenM5 =iCustom(NULL,PM5,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
haCloseM5 =iCustom(NULL,PM5,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,0);
haOpenM5B =iCustom(NULL,PM5,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,1,0);
haCloseM5B =iCustom(NULL,PM5,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,0,0);
haOpenM15 =iCustom(NULL,PM15,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
haCloseM15 =iCustom(NULL,PM15,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,0);
haOpenM15B =iCustom(NULL,PM15,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,1,0);
haCloseM15B =iCustom(NULL,PM15,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,0,0);
haOpenM30 =iCustom(NULL,PM30,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
haCloseM30 =iCustom(NULL,PM30,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,0);
haOpenM30B =iCustom(NULL,PM30,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,1,0);
haCloseM30B =iCustom(NULL,PM30,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,0,0);
haOpenH1 =iCustom(NULL,PH1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
haCloseH1 =iCustom(NULL,PH1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,0);
haOpenH1B =iCustom(NULL,PH1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,1,0);
haCloseH1B =iCustom(NULL,PH1,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,0,0);
haOpenH4 =iCustom(NULL,PH4,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
haCloseH4 =iCustom(NULL,PH4,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,0);
haOpenH4B =iCustom(NULL,PH4,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,1,0);
haCloseH4B =iCustom(NULL,PH4,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,0,0);
//check positions for volty
Volt1M1=iCustom(Symbol(),PM1,"VoltyChannel_Stop_v2.1",0,0);
Volt2M1=iCustom(Symbol(),PM1,"VoltyChannel_Stop_v2.1",1,0);
Volt1M5=iCustom(Symbol(),PM5,"VoltyChannel_Stop_v2.1",0,0);
Volt2M5=iCustom(Symbol(),PM5,"VoltyChannel_Stop_v2.1",1,0);
Volt1M15=iCustom(Symbol(),PM15,"VoltyChannel_Stop_v2.1",0,0);
Volt2M15=iCustom(Symbol(),PM15,"VoltyChannel_Stop_v2.1",1,0);
Volt1M30=iCustom(Symbol(),PM30,"VoltyChannel_Stop_v2.1",0,0);
Volt2M30=iCustom(Symbol(),PM30,"VoltyChannel_Stop_v2.1",1,0);
Volt1H1=iCustom(Symbol(),PH1,"VoltyChannel_Stop_v2.1",0,0);
Volt2H1=iCustom(Symbol(),PH1,"VoltyChannel_Stop_v2.1",1,0);
Volt1H4=iCustom(Symbol(),PH4,"VoltyChannel_Stop_v2.1",0,0);
Volt2H4=iCustom(Symbol(),PH4,"VoltyChannel_Stop_v2.1",1,0);
// for opening display /////////////////////////////////////////////////////////
if(LastTrade =="" || LastTrade == "CloseBuy" || LastTrade == "CloseSell")
{
MaSigM1 ="";
MaSigM5 ="";
MaSigM15 ="";
MaSigM30 ="";
MaSigH1 ="";
MaSigH4 ="";
HASSigM1 ="";
HASSigM5 ="";
HASSigM15 ="";
HASSigM30 ="";
HASSigH1 ="";
HASSigH4 ="";
VoltSigM1 ="";
VoltSigM5 ="";
VoltSigM15 ="";
VoltSigM30 ="";
VoltSigH1 ="";
VoltSigH4 ="";
// USE volty chanel index ********************************************************************
if (VoltInd==true)
{
if (OpVoltUseM1 == true)
{
if (Volt1M1> Volt2M1)
VoltSigM1="2";
if (Volt1M1 < Volt2M1)
VoltSigM1 ="1";
}
if (OpVoltUseM5 == true)
{
if (Volt1M5> Volt2M5)
VoltSigM5="2";
if (Volt1M5 < Volt2M5)
VoltSigM5 ="1";
}
if (OpVoltUseM15 == true)
{
if (Volt1M15> Volt2M15)
VoltSigM15="2";
if (Volt1M15 < Volt2M15)
VoltSigM15 ="1";
}
if (OpVoltUseM30 == true)
{
if (Volt1M30> Volt2M30)
VoltSigM30="2";
if (Volt1M30 < Volt2M30)
VoltSigM30 ="1";
}
if (OpVoltUseH1 == true)
{
if (Volt1H1 > Volt2H1)
VoltSigH1="2";
if (Volt1H1 < Volt2H1)
VoltSigH1 = "1";
}
if (OpVoltUseH4 == true)
{
if (Volt1H4> Volt2H4)
VoltSigH4="2";
if (Volt1H4 < Volt2H4)
VoltSigH4 ="1";
}
}
// USE HEIKEN ASHI
if (UseHAS==true )
{
if (OpHASUseM1==true)
{
if((haOpenM1>=haCloseM1)&&(haOpenM1B<haCloseM1B))
{
RefreshRates();
M1Sell = true;
M1Buy = false;
HASSigM1 = "2";
}
else
{
M1Buy = true;
M1Sell = false;
HASSigM1 = "1";
}
}
if (OpHASUseM5==true)
{
if((haOpenM5>=haCloseM5)&&(haOpenM5B<haCloseM5B))
{
M5Sell = true;
M5Buy = false;
HASSigM5 = "2";
}
else
{M5Buy = true;
M5Sell=false;
HASSigM5 = "1";
}
}
if (OpHASUseM15==true)
{
if((haOpenM15>=haCloseM15)&&(haOpenM15B<haCloseM15B))
{
RefreshRates();
M15Sell = true;
M15Buy = false;
HASSigM15 = "2";
}
else
{M15Buy = true;
M15Sell=false;
HASSigM15 = "1";
}
}
if (OpHASUseM30==true)
{
if((haOpenM30>=haCloseM30)&&(haOpenM30B<haCloseM30B))
{
M30Sell = true;
M30Buy = false;
HASSigM30 = "2";
}
else
{M30Buy = true;
M30Sell = false;
HASSigM30 = "1";
}
}
if (OpHASUseH1==true)
{
if((haOpenH1>=haCloseH1)&&(haOpenH1B<haCloseH1B))
{
RefreshRates();
H1Sell = true;
H1Buy = false;
HASSigH1 = "2";
}
else
{H1Buy = true;
H1Sell = false;
HASSigH1 = "1";
}
}
if (OpHASUseH4==true)
{
if((haOpenH4>=haCloseH4)&&(haOpenH4B<haCloseH4B))
{
RefreshRates();
H4Sell = true;
H4Buy = false;
HASSigH4 = "2";
}
else
{H4Buy = true;
H4Sell = false;
HASSigH4 = "1";
}
}
}
// use m1 for moving average
if (UseMovingAverage==true )
{
if (OpMaUseM1==true)
{
if (Ma1M1 < Ma2M1)
{
MaM1Sell = true;
MaM1Buy = false;
MaSigM1 = "2";
}
else
if(Ma1M1 > Ma2M1)
{MaM1Buy = true;
MaM1Sell=false;
MaSigM1 = "1";
}
}
if (OpMaUseM5==true)
{
if (Ma1M5 < Ma2M5)
{
MaM5Sell = true;
MaM5Buy = false;
MaSigM5 = "2";
}
else
if(Ma1M5 > Ma2M5)
{MaM5Buy = true;
MaM5Sell=false;
MaSigM5 = "1";
}
}
if (OpMaUseM15==true)
{
if(Ma1M15 < Ma2M15)
{
RefreshRates();
MaM15Sell = true;
MaM15Buy = false;
MaSigM15 = "2";
}
else
if(Ma1M15 > Ma2M15)
{MaM15Buy = true;
MaM15Sell=false;
MaSigM15 = "1";
}
}
if (OpMaUseM30==true)
{
if(Ma1M30 < Ma2M30)
{
MaM30Sell = true;
MaM30Buy = false;
MaSigM30 = "2";
}
else
if(Ma1M30 > Ma2M30)
{MaM30Buy = true;
MaM30Sell = false;
MaSigM30 = "1";
}
}
if (OpMaUseH1==true)
{
if(Ma1H1 < Ma2H1)
{
RefreshRates();
MaH1Sell = true;
MaH1Buy = false;
MaSigH1 = "2";
}
else
if(Ma1H1 > Ma2H1)
{MaH1Buy = true;
MaH1Sell = false;
MaSigH1 = "1";
}
}
if (OpMaUseH4==true)
{
if(Ma1H4 < Ma2H4)
{
RefreshRates();
MaH4Sell = true;
MaH4Buy = false;
MaSigH4 = "2";
}
else
if(Ma1H4 > Ma2H4)
{
MaH4Buy = true;
MaH4Sell = false;
MaSigH4 = "1";
}
}
}
} // end display for opening
// for display with closing trade ////////////////////////////////////////////////////////
if (LastTrade == "Buy" || LastTrade == "Sell")
{
MaSigM1 ="";
MaSigM5 ="";
MaSigM15 ="";
MaSigM30 ="";
MaSigH1 ="";
MaSigH4 ="";
HASSigM1 ="";
HASSigM5 ="";
HASSigM15 ="";
HASSigM30 ="";
HASSigH1 ="";
HASSigH4 ="";
VoltSigM1 ="";
VoltSigM5 ="";
VoltSigM15 ="";
VoltSigM30 ="";
VoltSigH1 ="";
VoltSigH4 ="";
// USE volty chanel index ********************************************************************
if (ClVoltUseM1 == true)
{
if (Volt1M1> Volt2M1)
VoltSigM1="2";
if (Volt1M1 < Volt2M1)
VoltSigM1 ="1";
}
if (ClVoltUseM5 == true)
{
if (Volt1M5> Volt2M5)
VoltSigM5="2";
if (Volt1M5 < Volt2M5)
VoltSigM5 ="1";
}
if (ClVoltUseM15 == true)
{
if (Volt1M15> Volt2M15)
VoltSigM15="2";
if (Volt1M15 < Volt2M15)
VoltSigM15 ="1";
}
if (ClVoltUseM30 == true)
{
if (Volt1M30> Volt2M30)
VoltSigM30="2";
if (Volt1M30 < Volt2M30)
VoltSigM30 ="1";
}
if (ClVoltUseH1 == true)
{
if (Volt1H1 > Volt2H1)
VoltSigH1="2";
if (Volt1H1 < Volt2H1)
VoltSigH1 = "1";
}
if (ClVoltUseH4 == true)
{
if (Volt1H4> Volt2H4)
VoltSigH4="2";
if (Volt1H4 < Volt2H4)
VoltSigH4 ="1";
}
// USE HEIKEN ASHI
if (ClHASUseM1==true)
{
if((haOpenM1>=haCloseM1)&&(haOpenM1B<haCloseM1B))
{
RefreshRates();
M1Sell = true;
M1Buy = false;
HASSigM1 = "2";
}
else
{
M1Buy = true;
M1Sell = false;
HASSigM1 = "1";
}
}
if (ClHASUseM5==true)
{
if((haOpenM5>=haCloseM5)&&(haOpenM5B<haCloseM5B))
{
M5Sell = true;
M5Buy = false;
HASSigM5 = "2";
}
else
{M5Buy = true;
M5Sell=false;
HASSigM5 = "1";
}
}
if (ClHASUseM15==true)
{
if((haOpenM15>=haCloseM15)&&(haOpenM15B<haCloseM15B))
{
RefreshRates();
M15Sell = true;
M15Buy = false;
HASSigM15 = "2";
}
else
{M15Buy = true;
M15Sell=false;
HASSigM15 = "1";
}
}
if (ClHASUseM30==true)
{
if((haOpenM30>=haCloseM30)&&(haOpenM30B<haCloseM30B))
{
M30Sell = true;
M30Buy = false;
HASSigM30 = "2";
}
else
{M30Buy = true;
M30Sell = false;
HASSigM30 = "1";
}
}
if (ClHASUseH1==true)
{
if((haOpenH1>=haCloseH1)&&(haOpenH1B<haCloseH1B))
{
RefreshRates();
H1Sell = true;
H1Buy = false;
HASSigH1 = "2";
}
else
{H1Buy = true;
H1Sell = false;
HASSigH1 = "1";
}
}
if (ClHASUseH4==true)
{
if((haOpenH4>=haCloseH4)&&(haOpenH4B<haCloseH4B))
{
RefreshRates();
H4Sell = true;
H4Buy = false;
HASSigH4 = "2";
}
else
{H4Buy = true;
H4Sell = false;
HASSigH4 = "1";
}
}
// use for moving average
if (ClMaUseM1==true)
{
if (Ma1M1 < Ma2M1)
{
MaM1Sell = true;
MaM1Buy = false;
MaSigM1 = "2";
}
else
if(Ma1M1 > Ma2M1)
{MaM1Buy = true;
MaM1Sell=false;
MaSigM1 = "1";
}
}
if (ClMaUseM5==true)
{
if (Ma1M5 < Ma2M5)
{
MaM5Sell = true;
MaM5Buy = false;
MaSigM5 = "2";
}
else
if(Ma1M5 > Ma2M5)
{MaM5Buy = true;
MaM5Sell=false;
MaSigM5 = "1";
}
}
if (ClMaUseM15==true)
{
if(Ma1M15 < Ma2M15)
{
RefreshRates();
MaM15Sell = true;
MaM15Buy = false;
MaSigM15 = "2";
}
else
if(Ma1M15 > Ma2M15)
{MaM15Buy = true;
MaM15Sell=false;
MaSigM15 = "1";
}
}
if (ClMaUseM30==true)
{
if(Ma1M30 < Ma2M30)
{
MaM30Sell = true;
MaM30Buy = false;
MaSigM30 = "2";
}
else
if(Ma1M30 > Ma2M30)
{MaM30Buy = true;
MaM30Sell = false;
MaSigM30 = "1";
}
}
if (ClMaUseH1==true)
{
if(Ma1H1 < Ma2H1)
{
RefreshRates();
MaH1Sell = true;
MaH1Buy = false;
MaSigH1 = "2";
}
else
if(Ma1H1 > Ma2H1)
{MaH1Buy = true;
MaH1Sell = false;
MaSigH1 = "1";
}
}
if (ClMaUseH4==true)
{
if(Ma1H4 < Ma2H4)
{
RefreshRates();
MaH4Sell = true;
MaH4Buy = false;
MaSigH4 = "2";
}
else
if(Ma1H4 > Ma2H4)
{
MaH4Buy = true;
MaH4Sell = false;
MaSigH4 = "1";
}
}
}
// end determine for close of buy/sell
if(LastTrade =="" || LastTrade =="CloseSell" || LastTrade == "CloseBuy")
{
// DETERMINE SELLING FOR MA ////////////////////////////////
if (MaAllBuy ==false)
{
if ((OpMaUseM1 == true) && (MaM1Sell == true))
{
OpSigMaM1Sell = "1";
}
if ((OpMaUseM1 == true) && (MaM1Sell == false))
{
OpSigMaM1Sell = "2";
}
if ((OpMaUseM1 == false) )
{
OpSigMaM1Sell = "3";
}
if ((OpMaUseM5 == true) && (MaM5Sell == true))
{
OpSigMaM5Sell = "1";
}
if ((OpMaUseM5 == true) && (MaM5Sell == false))
{
OpSigMaM5Sell = "2";
}
if ((OpMaUseM5 == false) )
{
OpSigMaM5Sell = "3";
}
if ((OpMaUseM15 == true) && (MaM15Sell == true))
{
OpSigMaM15Sell = "1";
}
if ((OpMaUseM15 == true) && (MaM15Sell == false))
{
OpSigMaM15Sell = "2";
}
if ((OpMaUseM15 == false) )
{
OpSigMaM15Sell = "3";
}
if ((OpMaUseM30 == true) && (MaM30Sell == true))
{
OpSigMaM30Sell = "1";
}
if ((OpMaUseM30 == true) && (MaM30Sell == false))
{
OpSigMaM30Sell = "2";
}
if ((OpMaUseM30 == false) )
{
OpSigMaM30Sell = "3";
}
if ((OpMaUseH1 == true) && (MaH1Sell == true))
{
OpSigMaH1Sell = "1";
}
if ((OpMaUseH1 == true) && (MaH1Sell == false))
{
OpSigMaH1Sell = "2";
}
if ((OpMaUseH1 == false) )
{
OpSigMaH1Sell = "3";
}
if ((OpMaUseH4 == true) && (MaH4Sell == true))
{
OpSigMaH4Sell = "1";
}
if ((OpMaUseH4 == true) && (MaH4Sell == false))
{
OpSigMaH4Sell = "2";
}
if ((OpMaUseH4 == false) )
{
OpSigMaH4Sell = "3";
}
if (
(OpSigMaM1Sell =="1" || OpSigMaM1Sell =="3")
&&
(OpSigMaM5Sell =="1" || OpSigMaM5Sell =="3")
&&
(OpSigMaM15Sell =="1" || OpSigMaM15Sell =="3")
&&
(OpSigMaM30Sell =="1" || OpSigMaM30Sell =="3")
&&
(OpSigMaH1Sell =="1" || OpSigMaH1Sell =="3")
&&
(OpSigMaH4Sell =="1" || OpSigMaH4Sell =="3")
)
{
RefreshRates();
MaAllSell=true;
MaAllBuy = false;
MaCloseBuy = false;
MaCloseSell = false;
}
if (
(OpSigMaM1Sell =="2")
||
(OpSigMaM5Sell =="2")
||
(OpSigMaM15Sell =="2")
||
(OpSigMaM30Sell =="2")
||
(OpSigMaH1Sell =="2")
||
(OpSigMaH4Sell =="2")
)
{
MaAllSell=false;
MaAllBuy = false;
MaCloseBuy = false;
MaCloseSell = false;
}
//***********************
}
// determine buying for ma *******************************************
if (MaAllSell ==false)
{
if ((OpMaUseM1 == true) && (MaM1Buy == true))
{
OpSigMaM1Buy = "1";
}
if ((OpMaUseM1 == true) && (MaM1Buy == false))
{
OpSigMaM1Buy = "2";
}
if ((OpMaUseM1 == false) )
{
OpSigMaM1Buy = "3";
}
if ((OpMaUseM5 == true) && (MaM5Buy == true))
{
OpSigMaM5Buy = "1";
}
if ((OpMaUseM5 == true) && (MaM5Buy == false))
{
OpSigMaM5Buy = "2";
}
if ((OpMaUseM5 == false) )
{
OpSigMaM5Buy = "3";
}
if ((OpMaUseM15 == true) && (MaM15Buy == true))
{
OpSigMaM15Buy = "1";
}
if ((OpMaUseM15 == true) && (MaM15Buy == false))
{
OpSigMaM15Buy = "2";
}
if ((OpMaUseM15 == false) )
{
OpSigMaM15Buy = "3";
}
if ((OpMaUseM30 == true) && (MaM30Buy == true))
{
OpSigMaM30Buy = "1";
}
if ((OpMaUseM30 == true) && (MaM30Buy == false))
{
OpSigMaM30Buy = "2";
}
if ((OpMaUseM30 == false) )
{
OpSigMaM30Buy = "3";
}
if ((OpMaUseH1 == true) && (MaH1Buy == true))
{
OpSigMaH1Buy = "1";
}
if ((OpMaUseH1 == true) && (MaH1Buy == false))
{
OpSigMaH1Buy = "2";
}
if ((OpMaUseH1 == false) )
{
OpSigMaH1Buy = "3";
}
if ((OpMaUseH4 == true) && (MaH4Buy == true))
{
OpSigMaH4Buy = "1";
}
if ((OpMaUseH4 == true) && (MaH4Buy == false))
{
OpSigMaH4Buy = "2";
}
if ((OpMaUseH4 == false) )
{
OpSigMaH4Buy = "3";
}
if (
(OpSigMaM1Buy =="1" || OpSigMaM1Buy =="3")
&&
(OpSigMaM5Buy =="1" || OpSigMaM5Buy =="3")
&&
(OpSigMaM15Buy =="1" || OpSigMaM15Buy =="3")
&&
(OpSigMaM30Buy =="1" || OpSigMaM30Buy =="3")
&&
(OpSigMaH1Buy =="1" || OpSigMaH1Buy =="3")
&&
(OpSigMaH4Buy =="1" || OpSigMaH4Buy =="3")
)
{
RefreshRates();
MaAllBuy=true;
MaAllSell = false;
MaCloseBuy = false;
MaCloseSell = false;
}
if (
(OpSigMaM1Buy =="2")
||
(OpSigMaM5Buy =="2")
||
(OpSigMaM15Buy =="2")
||
(OpSigMaM30Buy =="2")
||
(OpSigMaH1Buy =="2")
||
(OpSigMaH4Buy =="2")
)
{
MaAllBuy=false;
MaAllSell = false;
MaCloseBuy = false;
MaCloseSell = false;
}
}
///////////////////////////////////// volty ///////////////////////////////////////////////
// DETERMINE SELLING FOR Volt ////////////////////////////////
if (VoltAllBuy ==false )
{
if ((OpVoltUseM1 == true) && (VoltSigM1=="2"))
{
OpSigVoltM1Sell = "1";
}
if ((OpVoltUseM1 == true) && (VoltSigM1 =="1"))
{
OpSigVoltM1Sell = "2";
}
if ((OpVoltUseM1 == false) )
{
OpSigVoltM1Sell = "3";
}
if ((OpVoltUseM5 == true) && (VoltSigM5=="2"))
{
OpSigVoltM5Sell = "1";
}
if ((OpVoltUseM5 == true) && (VoltSigM5=="1"))
{
OpSigVoltM5Sell = "2";
}
if ((OpVoltUseM5 == false) )
{
OpSigVoltM5Sell = "3";
}
if ((OpVoltUseM15 == true) && (VoltSigM15=="2"))
{
OpSigVoltM15Sell = "1";
}
if ((OpVoltUseM15 == true) && (VoltSigM15=="1"))
{
OpSigVoltM15Sell = "2";
}
if ((OpVoltUseM15 == false) )
{
OpSigVoltM15Sell = "3";
}
if ((OpVoltUseM30 == true) && (VoltSigM30=="2"))
{
OpSigVoltM30Sell = "1";
}
if ((OpVoltUseM30 == true) && (VoltSigM30=="1"))
{
OpSigVoltM30Sell = "2";
}
if ((OpVoltUseM30 == false) )
{
OpSigVoltM30Sell = "3";
}
if ((OpVoltUseH1 == true) && (VoltSigH1=="2"))
{
OpSigVoltH1Sell = "1";
}
if ((OpVoltUseH1 == true) && (VoltSigH1=="1"))
{
OpSigVoltH1Sell = "2";
}
if ((OpVoltUseH1 == false) )
{
OpSigVoltH1Sell = "3";
}
if ((OpVoltUseH4 == true) && (VoltSigH4=="2"))
{
OpSigVoltH4Sell = "1";
}
if ((OpVoltUseH4 == true) && (VoltSigH4=="1"))
{
OpSigVoltH4Sell = "2";
}
if ((OpVoltUseH4 == false) )
{
OpSigVoltH4Sell = "3";
}
if (
(OpSigVoltM1Sell =="1" || OpSigVoltM1Sell =="3")
&&
(OpSigVoltM5Sell =="1" || OpSigVoltM5Sell =="3")
&&
(OpSigVoltM15Sell =="1" || OpSigVoltM15Sell =="3")
&&
(OpSigVoltM30Sell =="1" || OpSigVoltM30Sell =="3")
&&
(OpSigVoltH1Sell =="1" || OpSigVoltH1Sell =="3")
&&
(OpSigVoltH4Sell =="1" || OpSigVoltH4Sell =="3")
)
{
RefreshRates();
VoltAllSell=true;
VoltAllBuy = false;
VoltCloseBuy = false;
VoltCloseSell = false;
}
if (
(OpSigVoltM1Sell =="2")
||
(OpSigVoltM5Sell =="2")
||
(OpSigVoltM15Sell =="2")
||
(OpSigVoltM30Sell =="2")
||
(OpSigVoltH1Sell =="2")
||
(OpSigVoltH4Sell =="2")
)
{
VoltAllSell=false;
VoltAllBuy = false;
VoltCloseBuy = false;
VoltCloseSell = false;
}
//***********************
}
// determine buying for Volt *******************************************
if (VoltAllSell ==false)
{
if ((OpVoltUseM1 == true) && (VoltSigM1=="1"))
{
OpSigVoltM1Buy = "1";
}
if ((OpVoltUseM1 == true) && (VoltSigM1=="2"))
{
OpSigVoltM1Buy = "2";
}
if ((OpVoltUseM1 == false) )
{
OpSigVoltM1Buy = "3";
}
if ((OpVoltUseM5 == true) && (VoltSigM5=="1"))
{
OpSigVoltM5Buy = "1";
}
if ((OpVoltUseM5 == true) && (VoltSigM5=="2"))
{
OpSigVoltM5Buy = "2";
}
if ((OpVoltUseM5 == false) )
{
OpSigVoltM5Buy = "3";
}
if ((OpVoltUseM15 == true) && (VoltSigM15=="1"))
{
OpSigVoltM15Buy = "1";
}
if ((OpVoltUseM15 == true) && (VoltSigM15=="2"))
{
OpSigVoltM15Buy = "2";
}
if ((OpVoltUseM15 == false) )
{
OpSigVoltM15Buy = "3";
}
if ((OpVoltUseM30 == true) && (VoltSigM30=="1"))
{
OpSigVoltM30Buy = "1";
}
if ((OpVoltUseM30 == true) && (VoltSigM30=="2"))
{
OpSigVoltM30Buy = "2";
}
if ((OpVoltUseM30 == false) )
{
OpSigVoltM30Buy = "3";
}
if ((OpVoltUseH1 == true) && (VoltSigH1=="1"))
{
OpSigVoltH1Buy = "1";
}
if ((OpVoltUseH1 == true) && (VoltSigH1=="2"))
{
OpSigVoltH1Buy = "2";
}
if ((OpVoltUseH1 == false) )
{
OpSigVoltH1Buy = "3";
}
if ((OpVoltUseH4 == true) && (VoltSigH4=="1"))
{
OpSigVoltH4Buy = "1";
}
if ((OpVoltUseH4 == true) && (VoltSigH4=="2"))
{
OpSigVoltH4Buy = "2";
}
if ((OpVoltUseH4 == false) )
{
OpSigVoltH4Buy = "3";
}
if (
(OpSigVoltM1Buy =="1" || OpSigVoltM1Buy =="3")
&&
(OpSigVoltM5Buy =="1" || OpSigVoltM5Buy =="3")
&&
(OpSigVoltM15Buy =="1" || OpSigVoltM15Buy =="3")
&&
(OpSigVoltM30Buy =="1" || OpSigVoltM30Buy =="3")
&&
(OpSigVoltH1Buy =="1" || OpSigVoltH1Buy =="3")
&&
(OpSigVoltH4Buy =="1" || OpSigVoltH4Buy =="3")
)
{
RefreshRates();
VoltAllBuy=true;
VoltAllSell = false;
VoltCloseBuy = false;
VoltCloseSell = false;
}
if (
(OpSigVoltM1Buy =="2")
||
(OpSigVoltM5Buy =="2")
||
(OpSigVoltM15Buy =="2")
||
(OpSigVoltM30Buy =="2")
||
(OpSigVoltH1Buy =="2")
||
(OpSigVoltH4Buy =="2")
)
{
VoltAllBuy=false;
VoltAllSell = false;
VoltCloseBuy = false;
VoltCloseSell = false;
}
}
//////////////////////////////////// has ///////////////////////////////////////////////
// DETERMINE SELLING FOR HAS ////////////////////////////////
//if (AllBuy ==false)
{
if ((OpHASUseM1 == true) && (HASSigM1=="2"))
{
OpSigHASM1Sell = "1";
}
if ((OpHASUseM1 == true) && (HASSigM1!="2"))
{
OpSigHASM1Sell = "2";
}
if ((OpHASUseM1 == false) )
{
OpSigHASM1Sell = "3";
}
if ((OpHASUseM5 == true) && (HASSigM5=="2"))
{
OpSigHASM5Sell = "1";
}
if ((OpHASUseM5 == true) && (HASSigM5!="2"))
{
OpSigHASM5Sell = "2";
}
if ((OpHASUseM5 == false) )
{
OpSigHASM5Sell = "3";
}
if ((OpHASUseM15 == true) && (HASSigM15=="2"))
{
OpSigHASM15Sell = "1";
}
if ((OpHASUseM15 == true) && (HASSigM15!="2"))
{
OpSigHASM15Sell = "2";
}
if ((OpHASUseM15 == false) )
{
OpSigHASM15Sell = "3";
}
if ((OpHASUseM30 == true) && (HASSigM30=="2"))
{
OpSigHASM30Sell = "1";
}
if ((OpHASUseM30 == true) && (HASSigM30!="2"))
{
OpSigHASM30Sell = "2";
}
if ((OpHASUseM30 == false) )
{
OpSigHASM30Sell = "3";
}
if ((OpHASUseH1 == true) && (HASSigH1=="2"))
{
OpSigHASH1Sell = "1";
}
if ((OpHASUseH1 == true) && (HASSigH1!="2"))
{
OpSigHASH1Sell = "2";
}
if ((OpHASUseH1 == false) )
{
OpSigHASH1Sell = "3";
}
if ((OpHASUseH4 == true) && (HASSigH4=="2"))
{
OpSigHASH4Sell = "1";
}
if ((OpHASUseH4 == true) && (HASSigH4!="2"))
{
OpSigHASH4Sell = "2";
}
if ((OpHASUseH4 == false) )
{
OpSigHASH4Sell = "3";
}
if (
(OpSigHASM1Sell =="1" || OpSigHASM1Sell =="3")
&&
(OpSigHASM5Sell =="1" || OpSigHASM5Sell =="3")
&&
(OpSigHASM15Sell =="1" || OpSigHASM15Sell =="3")
&&
(OpSigHASM30Sell =="1" || OpSigHASM30Sell =="3")
&&
(OpSigHASH1Sell =="1" || OpSigHASH1Sell =="3")
&&
(OpSigHASH4Sell =="1" || OpSigHASH4Sell =="3")
)
{
RefreshRates();
AllSell=true;
AllBuy = false;
CloseBuy = false;
CloseSell = false;
}
if (
(OpSigHASM1Sell =="2")
||
(OpSigHASM5Sell =="2")
||
(OpSigHASM15Sell =="2")
||
(OpSigHASM30Sell =="2")
||
(OpSigHASH1Sell =="2")
||
(OpSigHASH4Sell =="2")
)
{
AllSell=false;
AllBuy = false;
CloseBuy = false;
CloseSell = false;
}
//***********************
}
// determine buying for HAS *******************************************
if (AllSell ==false)
{
if ((OpHASUseM1 == true) && (HASSigM1=="1"))
{
OpSigHASM1Buy = "1";
}
if ((OpHASUseM1 == true) && (HASSigM1!="1"))
{
OpSigHASM1Buy = "2";
}
if ((OpHASUseM1 == false) )
{
OpSigHASM1Buy = "3";
}
if ((OpHASUseM5 == true) && (HASSigM5=="1"))
{
OpSigHASM5Buy = "1";
}
if ((OpHASUseM5 == true) && (HASSigM5!="1"))
{
OpSigHASM5Buy = "2";
}
if ((OpHASUseM5 == false) )
{
OpSigHASM5Buy = "3";
}
if ((OpHASUseM15 == true) && (HASSigM15=="1"))
{
OpSigHASM15Buy = "1";
}
if ((OpHASUseM15 == true) && (HASSigM15!="1"))
{
OpSigHASM15Buy = "2";
}
if ((OpHASUseM15 == false) )
{
OpSigHASM15Buy = "3";
}
if ((OpHASUseM30 == true) && (HASSigM30=="1"))
{
OpSigHASM30Buy = "1";
}
if ((OpHASUseM30 == true) && (HASSigM30!="1"))
{
OpSigHASM30Buy = "2";
}
if ((OpHASUseM30 == false) )
{
OpSigHASM30Buy = "3";
}
if ((OpHASUseH1 == true) && (HASSigH1=="1"))
{
OpSigHASH1Buy = "1";
}
if ((OpHASUseH1 == true) && (HASSigH1!="1"))
{
OpSigHASH1Buy = "2";
}
if ((OpHASUseH1 == false) )
{
OpSigHASH1Buy = "3";
}
if ((OpHASUseH4 == true) && (HASSigH4=="1"))
{
OpSigHASH4Buy = "1";
}
if ((OpHASUseH4 == true) && (HASSigH4!="1"))
{
OpSigHASH4Buy = "2";
}
if ((OpHASUseH4 == false) )
{
OpSigHASH4Buy = "3";
}
if (
(OpSigHASM1Buy =="1" || OpSigHASM1Buy =="3")
&&
(OpSigHASM5Buy =="1" || OpSigHASM5Buy =="3")
&&
(OpSigHASM15Buy =="1" || OpSigHASM15Buy =="3")
&&
(OpSigHASM30Buy =="1" || OpSigHASM30Buy =="3")
&&
(OpSigHASH1Buy =="1" || OpSigHASH1Buy =="3")
&&
(OpSigHASH4Buy =="1" || OpSigHASH4Buy =="3")
)
{
RefreshRates();
AllBuy=true;
AllSell = false;
CloseBuy = false;
CloseSell = false;
}
if (
(OpSigHASM1Buy =="2")
||
(OpSigHASM5Buy =="2")
||
(OpSigHASM15Buy =="2")
||
(OpSigHASM30Buy =="2")
||
(OpSigHASH1Buy =="2")
||
(OpSigHASH4Buy =="2")
)
{
AllBuy=false;
AllSell = false;
CloseBuy = false;
CloseSell = false;
}
}
}
if (UseHAS == true || UseMovingAverage == true || VoltInd==true)
{
ObjectDelete("signal11");
ObjectDelete("signal12");
ObjectDelete("signal13");
ObjectDelete("signal14");
ObjectDelete("signal15");
ObjectDelete("signal16");
ObjectDelete("signal17");
ObjectDelete("signal18");
ObjectDelete("signal19");
ObjectDelete("signal20");
ObjectDelete("signal21");
ObjectDelete("signal22");
ObjectDelete("signal23");
ObjectDelete("signal24");
ObjectDelete("signal25");
ObjectDelete("signal26");
ObjectDelete("signal27");
ObjectDelete("signal28");
ObjectDelete("signal29");
ObjectDelete("signal30");
ObjectDelete("signal31");
ObjectDelete("signal32");
ObjectDelete("signal300");
ObjectDelete("signal301");
ObjectDelete("signal302");
ObjectDelete("signal303");
ObjectDelete("signal304");
ObjectDelete("signal305");
ObjectDelete("signal306");
ObjectDelete("signal307");
ObjectDelete("signal307");
ObjectDelete("signal308");
ObjectDelete("signal309");
ObjectDelete("signal310");
ObjectDelete("signal311");
ObjectDelete("signal312");
ObjectDelete("signal313");
if (LastTrade == "CloseBuy" || LastTrade == "CloseSell")
{
ObjectDelete("signalWOp");
ObjectCreate("signalWCl",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signalWCL",OBJPROP_XDISTANCE,110);
ObjectSet("signalWCl",OBJPROP_YDISTANCE,118);
ObjectSetText("signalWCl","Waiting To Get Signal to Open trade: Last Trade: " + LastTrade,10,"Ariel",Yellow);
}
if (LastTrade =="")
ObjectSetText("signalWCl","Waiting To Get Signal to Open trade: Last Trade: " + "No Previous Trade",10,"Ariel",Yellow);
if (LastTrade == "Buy" || LastTrade == "Sell")
{
ObjectDelete("signalWCl");
ObjectCreate("signalWOp",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signalWOp",OBJPROP_XDISTANCE,110);
ObjectSet("signalWOp",OBJPROP_YDISTANCE,118);
ObjectSetText("signalWOp","Waiting To Get Signal to Close trade: Last Trade: " + LastTrade,10,"Ariel",Yellow);
}
ObjectCreate("signala",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signala",OBJPROP_XDISTANCE,965);
ObjectSet("signala",OBJPROP_YDISTANCE,150);
ObjectSetText("signala","Ma1 cross Ma2 :",10,"Ariel",Yellow);
ObjectCreate("signal2",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal2",OBJPROP_XDISTANCE,965);
ObjectSet("signal2",OBJPROP_YDISTANCE,162);
ObjectSetText("signal2","HAS :",10,"Ariel",Yellow);
ObjectCreate("signal1",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal1",OBJPROP_XDISTANCE,965);
ObjectSet("signal1",OBJPROP_YDISTANCE,182);
ObjectSetText("signal1","Volt Ind :",10,"Ariel",Yellow);
ObjectCreate("signal3",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal3",OBJPROP_XDISTANCE,965);
ObjectSet("signal3",OBJPROP_YDISTANCE,138);
ObjectSetText("signal3","Period:",10,"Ariel",Yellow);
ObjectCreate("signal4",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal4",OBJPROP_XDISTANCE,1070);
ObjectSet("signal4",OBJPROP_YDISTANCE,138);
ObjectSetText("signal4","M1",8,"Ariel",Yellow);
ObjectCreate("signal5",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal5",OBJPROP_XDISTANCE,1090);
ObjectSet("signal5",OBJPROP_YDISTANCE,138);
ObjectSetText("signal5","M5",8,"Ariel",Yellow);
ObjectCreate("signal7",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal7",OBJPROP_XDISTANCE,1110);
ObjectSet("signal7",OBJPROP_YDISTANCE,138);
ObjectSetText("signal7","M15",8,"Ariel",Yellow);
ObjectCreate("signal8",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal8",OBJPROP_XDISTANCE,1130);
ObjectSet("signal8",OBJPROP_YDISTANCE,138);
ObjectSetText("signal8","M30",8,"Ariel",Yellow);
ObjectCreate("signal9",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal9",OBJPROP_XDISTANCE,1150);
ObjectSet("signal9",OBJPROP_YDISTANCE,138);
ObjectSetText("signal9","H1",8,"Ariel",Yellow);
ObjectCreate("signal10",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal10",OBJPROP_XDISTANCE,1170);
ObjectSet("signal10",OBJPROP_YDISTANCE,138);
ObjectSetText("signal10","H4",8,"Ariel",Yellow);
if(MaSigM1=="1")
{
ObjectDelete("signal12");
ObjectCreate("signal11",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal11",OBJPROP_XDISTANCE,1070);
ObjectSet("signal11",OBJPROP_YDISTANCE,150);
ObjectSetText("signal11",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(MaSigM1=="2")
{
ObjectDelete("signal11");
ObjectCreate("signal12",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal12",OBJPROP_XDISTANCE,1070);
ObjectSet("signal12",OBJPROP_YDISTANCE,150);
ObjectSetText("signal12",CharToStr(234),10,"Wingdings",Red);
}
if(MaSigM5=="1")
{
ObjectDelete("signal14");
ObjectCreate("signal13",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal13",OBJPROP_XDISTANCE,1090);
ObjectSet("signal13",OBJPROP_YDISTANCE,150);
ObjectSetText("signal13",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(MaSigM5=="2")
{
ObjectDelete("signal13");
ObjectCreate("signal14",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal14",OBJPROP_XDISTANCE,1090);
ObjectSet("signal14",OBJPROP_YDISTANCE,150);
ObjectSetText("signal14",CharToStr(234),10,"Wingdings",Red);
}if(MaSigM15=="1")
{
ObjectDelete("signal16");
ObjectCreate("signal15",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal15",OBJPROP_XDISTANCE,1110);
ObjectSet("signal15",OBJPROP_YDISTANCE,150);
ObjectSetText("signal15",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(MaSigM15=="2")
{
ObjectDelete("signal15");
ObjectCreate("signal16",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal16",OBJPROP_XDISTANCE,1110);
ObjectSet("signal16",OBJPROP_YDISTANCE,150);
ObjectSetText("signal16",CharToStr(234),10,"Wingdings",Red);
}if(MaSigM30=="1")
{
ObjectDelete("signal18");
ObjectCreate("signal17",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal17",OBJPROP_XDISTANCE,1130);
ObjectSet("signal17",OBJPROP_YDISTANCE,150);
ObjectSetText("signal17",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(MaSigM30=="2")
{
ObjectDelete("signal17");
ObjectCreate("signal18",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal18",OBJPROP_XDISTANCE,1130);
ObjectSet("signal18",OBJPROP_YDISTANCE,150);
ObjectSetText("signal18",CharToStr(234),10,"Wingdings",Red);
}if(MaSigH1=="1")
{
ObjectDelete("signal20");
ObjectCreate("signal19",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal19",OBJPROP_XDISTANCE,1150);
ObjectSet("signal19",OBJPROP_YDISTANCE,150);
ObjectSetText("signal19",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(MaSigH1=="2")
{
ObjectDelete("signal19");
ObjectCreate("signal20",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal20",OBJPROP_XDISTANCE,1150);
ObjectSet("signal20",OBJPROP_YDISTANCE,150);
ObjectSetText("signal20",CharToStr(234),10,"Wingdings",Red);
}if(MaSigH4=="1")
{
ObjectDelete("signal22");
ObjectCreate("signal21",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal21",OBJPROP_XDISTANCE,1170);
ObjectSet("signal21",OBJPROP_YDISTANCE,150);
ObjectSetText("signal21",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(MaSigH4=="2")
{
ObjectDelete("signal21");
ObjectCreate("signal22",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal22",OBJPROP_XDISTANCE,1170);
ObjectSet("signal22",OBJPROP_YDISTANCE,150);
ObjectSetText("signal22",CharToStr(234),10,"Wingdings",Red);
}
if(MaAllSell==true)
{
MaText= "All Sell Signal";
MaColor = Red;
}
if(MaAllBuy==true)
{
MaText= "All Buy Signal";
MaColor = RoyalBlue;
}
if(MaAllBuy==false && MaAllSell == false)
{
MaText= "No Signal";
MaColor = Yellow;
}
ObjectDelete("signalm223");
ObjectDelete("signalm224");
ObjectDelete("signal223");
ObjectCreate("signal224",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal224",OBJPROP_XDISTANCE,1200);
ObjectSet("signal224",OBJPROP_YDISTANCE,150);
ObjectSetText("signal224",MaText,8,"Ariel",MaColor);
if(MaCloseSell==true)
{
MaText= "Close Sell Signal";
MaColor = Red;
}
if(MaCloseBuy==true)
{
MaText= "Close Buy Signal";
MaColor = RoyalBlue;
}
if(MaCloseSell==false)
{
MaText= "No Signal";
MaColor = Yellow;
}
ObjectDelete("signal223");
ObjectDelete("signal224");
ObjectDelete("signalm223");
ObjectCreate("signalm224",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signalm224",OBJPROP_XDISTANCE,1200);
ObjectSet("signalm224",OBJPROP_YDISTANCE,150);
ObjectSetText("signalm224",MaText,8,"Ariel",MaColor);
if(HASSigM1=="1")
{
ObjectDelete("signal24");
ObjectCreate("signal23",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal23",OBJPROP_XDISTANCE,1070);
ObjectSet("signal23",OBJPROP_YDISTANCE,162);
ObjectSetText("signal23",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(HASSigM1=="2")
{
ObjectDelete("signal23");
ObjectCreate("signal24",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal24",OBJPROP_XDISTANCE,1070);
ObjectSet("signal24",OBJPROP_YDISTANCE,162);
ObjectSetText("signal24",CharToStr(234),10,"Wingdings",Red);
}
if(HASSigM5=="1")
{
ObjectDelete("signal26");
ObjectCreate("signal25",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal25",OBJPROP_XDISTANCE,1090);
ObjectSet("signal25",OBJPROP_YDISTANCE,162);
ObjectSetText("signal25",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(HASSigM5=="2")
{
ObjectDelete("signal25");
ObjectCreate("signal26",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal26",OBJPROP_XDISTANCE,1090);
ObjectSet("signal26",OBJPROP_YDISTANCE,162);
ObjectSetText("signal26",CharToStr(234),10,"Wingdings",Red);
}if(HASSigM15=="1")
{
ObjectDelete("signal28");
ObjectCreate("signal27",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal27",OBJPROP_XDISTANCE,1110);
ObjectSet("signal27",OBJPROP_YDISTANCE,162);
ObjectSetText("signal27",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(HASSigM15=="2")
{
ObjectDelete("signal27");
ObjectCreate("signal28",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal28",OBJPROP_XDISTANCE,1110);
ObjectSet("signal28",OBJPROP_YDISTANCE,162);
ObjectSetText("signal28",CharToStr(234),10,"Wingdings",Red);
}if(HASSigM30=="1")
{
ObjectDelete("signal30");
ObjectCreate("signal29",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal29",OBJPROP_XDISTANCE,1130);
ObjectSet("signal29",OBJPROP_YDISTANCE,162);
ObjectSetText("signal29",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(HASSigM30=="2")
{
ObjectDelete("signal29");
ObjectCreate("signal30",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal30",OBJPROP_XDISTANCE,1130);
ObjectSet("signal30",OBJPROP_YDISTANCE,162);
ObjectSetText("signal30",CharToStr(234),10,"Wingdings",Red);
}
if(HASSigH1=="1")
{
ObjectDelete("signal32");
ObjectCreate("signal31",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal31",OBJPROP_XDISTANCE,1150);
ObjectSet("signal31",OBJPROP_YDISTANCE,162);
ObjectSetText("signal31",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(HASSigH1=="2")
{
ObjectDelete("signal31");
ObjectCreate("signal32",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal32",OBJPROP_XDISTANCE,1150);
ObjectSet("signal32",OBJPROP_YDISTANCE,162);
ObjectSetText("signal32",CharToStr(234),10,"Wingdings",Red);
}
if(HASSigH4=="1")
{
ObjectDelete("signalb32");
ObjectCreate("signalb31",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signalb31",OBJPROP_XDISTANCE,1170);
ObjectSet("signalb31",OBJPROP_YDISTANCE,162);
ObjectSetText("signalb31",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(HASSigH4=="2")
{
ObjectDelete("signalb31");
ObjectCreate("signalb32",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signalb32",OBJPROP_XDISTANCE,1170);
ObjectSet("signalb32",OBJPROP_YDISTANCE,162);
ObjectSetText("signalb32",CharToStr(234),10,"Wingdings",Red);
}
if(AllSell==true)
{
HASText= "All Sell Signal";
HASColor = Red;
}
if(AllBuy==true)
{
HASText= "All Buy Signal";
HASColor = RoyalBlue;
}
if(AllBuy==false && AllSell == false)
{
HASText= "No Signal";
HASColor = Yellow;
}
ObjectDelete("signalh225");
ObjectDelete("signalh226");
ObjectDelete("signal225");
ObjectCreate("signal226",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal226",OBJPROP_XDISTANCE,1200);
ObjectSet("signal226",OBJPROP_YDISTANCE,162);
ObjectSetText("signal226",HASText,8,"Ariel",HASColor);
if(CloseSell==true)
{
HASText= "Close Sell Signal";
HASColor = Red;
}
if(CloseBuy==true)
{
HASText= "Close Buy Signal";
HASColor = RoyalBlue;
}
if(CloseBuy==false && CloseSell==false)
{
HASText= "No Signal";
HASColor = Yellow;
}
ObjectDelete("signal225");
ObjectDelete("signal226");
ObjectDelete("signalh225");
ObjectCreate("signalh226",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signalh226",OBJPROP_XDISTANCE,1200);
ObjectSet("signalh226",OBJPROP_YDISTANCE,162);
ObjectSetText("signalh226",HASText,8,"Ariel",HASColor);
// FOR VOLTY INDEX
if(VoltSigM1=="1")
{
ObjectDelete("signal301");
ObjectCreate("signal300",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal300",OBJPROP_XDISTANCE,1070);
ObjectSet("signal300",OBJPROP_YDISTANCE,182);
ObjectSetText("signal300",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(VoltSigM1=="2")
{
ObjectDelete("signal300");
ObjectCreate("signal301",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal301",OBJPROP_XDISTANCE,1070);
ObjectSet("signal301",OBJPROP_YDISTANCE,182);
ObjectSetText("signal301",CharToStr(234),10,"Wingdings",Red);
}
if(VoltSigM5=="1")
{
ObjectDelete("signal303");
ObjectCreate("signal302",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal302",OBJPROP_XDISTANCE,1090);
ObjectSet("signal302",OBJPROP_YDISTANCE,182);
ObjectSetText("signal302",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(VoltSigM5=="2")
{
ObjectDelete("signal302");
ObjectCreate("signal303",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal303",OBJPROP_XDISTANCE,1090);
ObjectSet("signal303",OBJPROP_YDISTANCE,182);
ObjectSetText("signal303",CharToStr(234),10,"Wingdings",Red);
}
if(VoltSigM15=="1")
{
ObjectDelete("signal305");
ObjectCreate("signal304",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal304",OBJPROP_XDISTANCE,1110);
ObjectSet("signal304",OBJPROP_YDISTANCE,182);
ObjectSetText("signal304",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(VoltSigM15=="2")
{
ObjectDelete("signal304");
ObjectCreate("signal305",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal305",OBJPROP_XDISTANCE,1110);
ObjectSet("signal305",OBJPROP_YDISTANCE,182);
ObjectSetText("signal305",CharToStr(234),10,"Wingdings",Red);
}
if(VoltSigM30=="1")
{
ObjectDelete("signal307");
ObjectCreate("signal306",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal306",OBJPROP_XDISTANCE,1130);
ObjectSet("signal306",OBJPROP_YDISTANCE,182);
ObjectSetText("signal306",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(VoltSigM30=="2")
{
ObjectDelete("signal306");
ObjectCreate("signal307",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal307",OBJPROP_XDISTANCE,1130);
ObjectSet("signal307",OBJPROP_YDISTANCE,182);
ObjectSetText("signal307",CharToStr(234),10,"Wingdings",Red);
}
if(VoltSigH1=="1")
{
ObjectDelete("signal309");
ObjectCreate("signal308",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal308",OBJPROP_XDISTANCE,1150);
ObjectSet("signal308",OBJPROP_YDISTANCE,182);
ObjectSetText("signal308",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(VoltSigH1=="2")
{
ObjectDelete("signal308");
ObjectCreate("signal309",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal309",OBJPROP_XDISTANCE,1150);
ObjectSet("signal309",OBJPROP_YDISTANCE,182);
ObjectSetText("signal309",CharToStr(234),10,"Wingdings",Red);
}
if(VoltSigH4=="1")
{
ObjectDelete("signal311");
ObjectCreate("signal310",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal310",OBJPROP_XDISTANCE,1170);
ObjectSet("signal310",OBJPROP_YDISTANCE,182);
ObjectSetText("signal310",CharToStr(233),10,"Wingdings",RoyalBlue);
}
if(VoltSigH4=="2")
{
ObjectDelete("signal310");
ObjectCreate("signal311",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal311",OBJPROP_XDISTANCE,1170);
ObjectSet("signal311",OBJPROP_YDISTANCE,182);
ObjectSetText("signal311",CharToStr(234),10,"Wingdings",Red);
}
if(VoltAllSell==true)
{
VText= "All Sell Signal";
VColor = Red;
}
if(VoltAllBuy==true)
{
VText= "All Buy Signal";
VColor = RoyalBlue;
}
if (VoltAllBuy == false && VoltAllSell == false)
{
VText= "No Signal";
VColor = Yellow;
}
ObjectDelete("signalv313");
ObjectDelete("signalv312");
ObjectDelete("signal313");
ObjectCreate("signal312",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal312",OBJPROP_XDISTANCE,1200);
ObjectSet("signal312",OBJPROP_YDISTANCE,182);
ObjectSetText("signal312",VText,8,"Ariel",VColor);
if(VoltCloseSell==true)
{
VText= "Close Sell Signal";
VColor = Red;
}
if(VoltCloseBuy==true)
{
VText= "Close Buy Signal";
VColor = RoyalBlue;
}
if (VoltCloseBuy == false && VoltCloseSell == false)
{
VText= "No Signal";
VColor = Yellow;
}
ObjectDelete("signal312");
ObjectDelete("signal313");
ObjectDelete("signalv313");
ObjectCreate("signalv312",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signalv312",OBJPROP_XDISTANCE,1200);
ObjectSet("signalv312",OBJPROP_YDISTANCE,182);
ObjectSetText("signalv312",VText,8,"Ariel",VColor);
} // end of display on chart section
///////////////////////////////
// **********************************************************************************//
// //
// //
// Order Trade Section //
// //
// //
// //
// **********************************************************************************//
if (
(UseHAS == true && UseMovingAverage==false && VoltInd == false)
)
{
if (CloseBuy == true) FinCloseBuy = true;
if (CloseSell == true) FinCloseSell = true;
if (AllBuy == true) FinBuy = true;
if (AllSell == true) FinSell = true;
}
if (
(UseHAS==false && UseMovingAverage == true && VoltInd == false)
)
{
if (MaCloseBuy == true) FinCloseBuy = true;
if (MaCloseSell == true) FinCloseSell = true;
if (MaAllBuy == true) FinBuy = true;
if (MaAllSell == true) FinSell = true;
}
if (
(UseHAS == false && UseMovingAverage==false && VoltInd == true)
)
{
if (VoltCloseBuy == true) FinCloseBuy = true;
if (VoltCloseSell == true) FinCloseSell = true;
if (VoltAllBuy == true) FinBuy = true;
if (VoltAllSell == true) FinSell = true;
}
if (
(UseHAS == false && UseMovingAverage==true && VoltInd == true)
)
{
if (MaCloseBuy == true && VoltCloseBuy == true) FinCloseBuy = true;
if (MaCloseSell == true && VoltCloseSell == true) FinCloseSell = true;
if (MaAllBuy == true && VoltAllBuy == true) FinBuy = true;
if (MaAllSell == true && VoltAllSell == true) FinSell = true;
}
if (
(UseHAS == true && UseMovingAverage==false && VoltInd == true)
)
{
if (CloseBuy == true && VoltCloseBuy == true) FinCloseBuy = true;
if (CloseSell == true && VoltCloseSell == true) FinCloseSell = true;
if (AllBuy == true && VoltAllBuy == true) FinBuy = true;
if (AllSell == true && VoltAllSell == true) FinSell = true;
}
if (
(UseHAS == true && UseMovingAverage==true && VoltInd == false)
)
{
if (CloseBuy == true && MaCloseBuy == true) FinCloseBuy = true;
if (CloseSell == true && MaCloseSell == true) FinCloseSell = true;
if (AllBuy == true && MaAllBuy == true) FinBuy = true;
if (AllSell == true && MaAllSell == true) FinSell = true;
}
if (
(UseHAS == true && UseMovingAverage==true && VoltInd == true)
)
{
if (CloseBuy == true && MaCloseBuy == true && VoltCloseBuy == true) FinCloseBuy = true;
if (CloseSell == true && MaCloseSell == true && VoltCloseSell == true) FinCloseSell = true;
if (AllBuy == true && MaAllBuy == true && VoltAllBuy == true) FinBuy = true;
if (AllSell == true && MaAllSell == true && VoltAllSell == true) FinSell = true;
}
RefreshRates();
for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
IsTrade = True;
if(OrderType() == OP_BUY) {
//Close
//+------------------------------------------------------------------+
//| Signal Begin(Exit Buy) |
//+------------------------------------------------------------------+
if (FinCloseBuy == true)
{ FinBuy=false;
FinSell=false;
Order = SIGNAL_CLOSEBUY;
}
//+------------------------------------------------------------------+
//| Signal End(Exit Buy) |
//+------------------------------------------------------------------+
if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid,4), Slippage, MediumSeaGreen);
LastTrade = "CloseBuy";
if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Bid,4), Digits) + " Close Buy");
if (!EachTickMode) BarCount = Bars;
IsTrade = False;
continue;
}
//Trailing stop
RefreshRates();
if(UseTrailingStop && TrailingStop > 0) {
if(NormalizeDouble(Bid,4) - OrderOpenPrice() > Point * TrailingStop) {
if(OrderStopLoss() < NormalizeDouble(Bid,4) - Point * TrailingStop) {
OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Bid,4) - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
if (!EachTickMode) BarCount = Bars;
continue;
}
}
}
} else {
//Close
//+------------------------------------------------------------------+
//| Signal Begin(Exit Sell) |
//+------------------------------------------------------------------+
if (FinCloseSell==true)
{ FinSell=false;
FinBuy = false;
Order = SIGNAL_CLOSESELL;}
//+------------------------------------------------------------------+
//| Signal End(Exit Sell) |
//+------------------------------------------------------------------+
RefreshRates();
if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask,4), Slippage, DarkOrange);
LastTrade = "CloseSell";
if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Ask,4), Digits) + " Close Sell");
if (!EachTickMode) BarCount = Bars;
IsTrade = False;
continue;
}
//Trailing stop
RefreshRates();
if(UseTrailingStop && TrailingStop > 0) {
if((OrderOpenPrice() - NormalizeDouble(Ask,4)) > (Point * TrailingStop)) {
if((OrderStopLoss() > (NormalizeDouble(Ask,4) + Point * TrailingStop)) || (OrderStopLoss() == 0)) {
OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Ask,4) + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);
if (!EachTickMode) BarCount = Bars;
continue;
}
}
}
}
}
}
//+------------------------------------------------------------------+
//| Signal Begin(Entry) |
//+------------------------------------------------------------------+
if (FinBuy == true)
{ FinCloseSell=false;
FinCloseBuy=false;
Order = SIGNAL_BUY;
}
//+------------------------------------------------------------------+
//| Signal End |
//+------------------------------------------------------------------+
//Buy
RefreshRates();
if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
if(!IsTrade) {
//Check free margin
if (AccountFreeMargin() < (1000 * Lots)) {
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
RefreshRates();
if (UseStopLoss) StopLossLevel = NormalizeDouble(Ask,4) - StopLoss * Point; else StopLossLevel = 0.0;
if (UseTakeProfit) TakeProfitLevel = NormalizeDouble(Ask,4) + TakeProfit * Point; else TakeProfitLevel = 0.0;
Ticket = OrderSend(Symbol(), OP_BUY, Lots, NormalizeDouble(Ask,4), Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
LastTrade = "Buy";
if(Ticket > 0) {
if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
Print("BUY order opened : ", OrderOpenPrice());
if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Ask,4), Digits) + " Open Buy");
} else {
Print("Error opening BUY order : ", GetLastError());
}
}
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}
//Sell
RefreshRates();
if (FinSell == true)
{ FinCloseSell=false;
FinCloseBuy=false;
Order = SIGNAL_SELL;
}
if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
if(!IsTrade) {
//Check free margin
if (AccountFreeMargin() < (1000 * Lots)) {
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
if (UseStopLoss) StopLossLevel = NormalizeDouble(Bid,4) + StopLoss * Point; else StopLossLevel = 0.0;
if (UseTakeProfit) TakeProfitLevel = NormalizeDouble(Bid,4) - TakeProfit * Point; else TakeProfitLevel = 0.0;
Ticket = OrderSend(Symbol(), OP_SELL, Lots, NormalizeDouble(Bid,4), Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
LastTrade = "Sell";
if(Ticket > 0) {
if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
Print("SELL order opened : ", OrderOpenPrice());
if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Bid,4), Digits) + " Open Sell");
} else {
Print("Error opening SELL order : ", GetLastError());
}
}
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}
if (!EachTickMode) BarCount = Bars;
return(0);
}
//----------------------- GENERATE MAGIC NUMBER BASE ON SYMBOL AND TIME FRAME FUNCTION
//----------------------- SOURCE : PENGIE
//----------------------- MODIFIED : FIREDAVE
int subGenerateMagicNumber(int MagicNumber, string symbol, int timeFrame)
{
int isymbol = 0;
if (symbol == "EURUSD") isymbol = 1;
else if (symbol == "GBPUSD") isymbol = 2;
else if (symbol == "USDJPY") isymbol = 3;
else if (symbol == "USDCHF") isymbol = 4;
else if (symbol == "AUDUSD") isymbol = 5;
else if (symbol == "USDCAD") isymbol = 6;
else if (symbol == "EURGBP") isymbol = 7;
else if (symbol == "EURJPY") isymbol = 8;
else if (symbol == "EURCHF") isymbol = 9;
else if (symbol == "EURAUD") isymbol = 10;
else if (symbol == "EURCAD") isymbol = 11;
else if (symbol == "GBPUSD") isymbol = 12;
else if (symbol == "GBPJPY") isymbol = 13;
else if (symbol == "GBPCHF") isymbol = 14;
else if (symbol == "GBPAUD") isymbol = 15;
else if (symbol == "GBPCAD") isymbol = 16;
else isymbol = 17;
if(isymbol<10) MagicNumber = MagicNumber * 10;
return (StrToInteger(StringConcatenate(MagicNumber, isymbol, timeFrame)));
}
void OutputLabelToChart(string a_name_0, int a_y_8, int a_fontsize_12, color a_color_16, string a_text_20, string as_28) {
if (ObjectFind(a_name_0) != 0) {
ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
ObjectSet(a_name_0, OBJPROP_CORNER, 0);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, 20);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_8);
}
ObjectSetText(a_name_0, a_text_20, a_fontsize_12, "Arial Bold", a_color_16);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---