← Назад к списку файлов

join the dots v1.3.mq4

Поиск по коду файла

#include <stdlib.mqh>
int MagicNumber = 0;
int ticket = 0;
double Price[2];
int    giSlippage;
extern int    ExpertID             = 994488;
extern int    TakeProfit           = 300;
extern double StopLoss             = 50;
extern double LotSize              = 0.1;
extern bool   useTakeProfit        = true;
extern bool   useStopLoss          = true;
extern bool   CloseOrdersOnNextDot = true;
extern bool   UseTripleIndicators  = true;
extern bool   TradeDelay           = true;
extern bool   MoneyManagement      = false;
extern int    PercentageToTrade    = 80;
extern int    AccountType          = 1;
extern int    Leverage             = 100;
extern int    Slippage             = 5;
color ExitLongColor = CLR_NONE;
color ExitShortColor = CLR_NONE;
extern string BuyComment           = "Join the Dots BUY";
extern string SellComment          = "Join the Dots SELL";

double PricePerPip;
double DecimalCorrection;
double DecimalPlaces;
double TP;
bool   BuySignal;
bool   SellSignal;

bool   CurrentBuyDot;
bool   CurrentSellDot;

bool   PreviousBuyDot;
bool   PreviousSellDot;

int init()
  {
      // код доступен только после оплаты
   }

int deinit()
  {

   return(0);
  }

int start()
  {
      // код доступен только после оплаты
   }

   double SL = StopLoss*Point;//by Saidas

   if (AccountType==0)
   {
      PricePerPip       = 10;
      DecimalCorrection = 0.5;
      DecimalPlaces     = 0;
   }

   if (AccountType==1)
   { 
      PricePerPip       = 10;
      DecimalCorrection = 0.05;
      DecimalPlaces     = 1;
   }

   if (AccountType==2)
   {
      PricePerPip       = 10;
      DecimalCorrection = 0.005;
      DecimalPlaces     = 2;
   }

   if (AccountType==3)
   {
      PricePerPip       = 1;
      DecimalCorrection = 0.005;
      DecimalPlaces     = 2;
   }

   if (MoneyManagement)
   {
      LotSize=NormalizeDouble(((AccountFreeMargin()*PercentageToTrade*Leverage)/
         (Ask*PricePerPip*1000000))-DecimalCorrection,DecimalPlaces);
   }

   MagicNumber = MakeMagicNumber( ExpertID, false );
   double MegaTrend_up     = iCustom(NULL, 0, "Mega trend",144,3,0,0,0);
   double MegaTrend_down   = iCustom(NULL, 0, "Mega trend",144,3,0,1,0);
   double MegaTrend_buffer = iCustom(NULL, 0, "Mega trend",144,3,0,2,0);
   string megatrend_direction, trendhisto_direction, swingzz_direction;

   if (MegaTrend_buffer == MegaTrend_up) {

      megatrend_direction = "up";
   } else if (MegaTrend_buffer == MegaTrend_down) {

      megatrend_direction = "down";
   } else {

      megatrend_direction = "flat";
   }

   double TrendHisto_up     = iCustom(NULL, 0, "Trend Histo",1500,1,0);
   double TrendHisto_down   = iCustom(NULL, 0, "Trend Histo",1500,2,0);
   double TrendHisto_buffer = iCustom(NULL, 0, "Trend Histo",1500,0,0);

   if (TrendHisto_buffer == TrendHisto_up) {

      trendhisto_direction = "up";
   } else if (TrendHisto_buffer == TrendHisto_down) {

      trendhisto_direction = "down";
   } else {

      trendhisto_direction = "flat";
   }

   double swingzz_up     = iCustom(NULL, 0, "Swing_ZZ",2,1,0);
   double swingzz_down   = iCustom(NULL, 0, "Swing_ZZ",2,2,0);
   double swingzz_buffer = iCustom(NULL, 0, "Swing_ZZ",2,0,0);

   if (TradeDelay)
   {
      if (UseTripleIndicators)
      {
         if (swingzz_down != 0 && megatrend_direction == "up" && trendhisto_direction == "up")
         {
            CurrentBuyDot=true;
         }
         else
         {
            CurrentBuyDot=false;
         }

         if (swingzz_up != 0 && megatrend_direction == "down" && trendhisto_direction == "down")
         {
            CurrentSellDot = true;
         }
         else
         {
            CurrentSellDot = false;
         }

         if (PreviousSellDot==true && CurrentSellDot==false)
         {
            SellSignal = true;
         }
         else
         {
            SellSignal = false;
         }

         if (PreviousBuyDot==true && CurrentBuyDot==false)
         {
            BuySignal = true;
         }
         else
         {
            BuySignal = false;
         }

         PreviousSellDot=CurrentSellDot;
         PreviousBuyDot =CurrentBuyDot;
      }
      else
      {
         if (swingzz_down != 0)
         {
            CurrentBuyDot=true;
         }
         else
         {
            CurrentBuyDot=false;
         }

         if (swingzz_up != 0)
         {
            CurrentSellDot = true;
         }
         else
         {
            CurrentSellDot = false;
         }

         if (PreviousSellDot==true && CurrentSellDot==false)
         {
            SellSignal = true;
         }
         else
         {
            SellSignal = false;
         }

         if (PreviousBuyDot==true && CurrentBuyDot==false)
         {
            BuySignal = true;
         }
         else
         {
            BuySignal = false;
         }

         PreviousSellDot=CurrentSellDot;
         PreviousBuyDot =CurrentBuyDot;
      }
   }
   else
   {
      if (UseTripleIndicators)
      {
         if (swingzz_down != 0 && megatrend_direction == "up" && trendhisto_direction == "up")
         {
            BuySignal = true;
         }
         else
         {
            BuySignal = false;
         }

         if (swingzz_up != 0 && megatrend_direction == "down" && trendhisto_direction == "down")
         {
            SellSignal = true;
         }
         else
         {
            SellSignal = false;
         }
      }
      else
      {
         if (swingzz_down != 0)
         {
            BuySignal = true;
         }
         else
         {
            BuySignal = false;
         }

     

Показано первые 50% кода (символов: 7428)

Как получить полную версию?

Введите ваш email и нажмите кнопку, чтобы перейти к оплате.