Ajuda na codificação - página 769

 
Olá Programadores


Espero que estejam bem aí. Por favor, poderiam me ajudar a remover o filtro de tempo neste EA/machave-o como falso e tornar o Fator Multiplicador Ajustável.


Muito obrigado.
Arquivos anexados:
EA.mq4  8 kb
 

Prezado(a) mladen,favor ser encorajado(a) a ver a aparência em M1

Obrigado

 

Olá a todos

Eu estava me perguntando se algum corpo pode me ajudar. Eu tenho um indicador que é basicamente um canal de regressão com um desvio de 2,0

coloquei-o no meta editor para poder adicionar mais duas linhas ao indicador que deseja por volta de 2,6 e, se possível, remover a linha central.

depois de muitas tentativas fracassadas, parece que não sei como fazer isso, então preciso de sua ajuda, por favor, se possível, obrigado.

Arquivos anexados:
i-Regr.mq4  6 kb
 

Prezado Mladen,

Estou tentando codificar meus primeiros indicadores, alguém está bem alguém não está..... com sua ajuda eu gostaria de me tornar um programador melhor....mas até agora eu realmente preciso de seu apoio....

Minha idéia é codificar um indicador que faz a EMA do oscilador stocastich....EMA (EMA (Stchastic)).... Estou tentando este indicador em uma plataforma online e foi fácil programá-lo, mas com o MT4 é mais difícil e estou cometendo erros porque ele não funciona......se importaria de dar uma olhada e corrigir os erros que estou cometendo?

muito obrigado pelo apoio

Gianluca

Arquivos anexados:
 
Mladen Rakic :
O arquivo ex4 não pode ser alterado

Prezado Mladen,


eu também estaria interessado em ter SL e TP em AngryBird..


Por favor, veja o código em anexo


Valeu

Chris

 //íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
#property copyright "" 
#property link        ""
//ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
double Stoploss = 500.0 ;             // óðîâåíü áåçóáûòêà
double TrailStart = 10.0 ;
double TrailStop = 10.0 ;
//ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
extern double LotExponent = 2 ;   // íà ñêîëüêî óìíîæàòü ëîò ïðè âûñòàâëåíèè ñëåäóþùåãî êîëåíà. ïðèìåð: ïåðâûé ëîò 0.1, ñåðèÿ: 0.16, 0.26, 0.43 ...
extern bool     DynamicPips                   = true ; 
extern int      DefaultPips                   = 12 ;
extern int Glubina = 24 ;
extern int DEL = 3 ;
extern double slip = 3.0 ;           // íà ñêîëüêî ìîæåò îòëè÷àòüñÿ öåíà â ñëó÷àå åñëè ÄÖ çàïðîñèò ðåêâîòû (â ïîñëåäíèé ìîìåíò íåìíîãî ïîìåíÿåò öåíó)
extern double Lots = 0.01 ;           // ðàçåð ëîòà äëÿ íà÷àëà òîðãîâ
extern int lotdecimal = 2 ;           // ñêîëüêî çíàêîâ ïîñëå çàïÿòîé â ëîòå ðàññ÷èòûâàòü 0 - íîðìàëüíûå ëîòû (1), 1 - ìèíèëîòû (0.1), 2 - ìèêðî (0.01)
extern double TakeProfit = 20.0 ;     // ïî äîñòèæåíèè ñêîëüêèõ ïóíêòîâ ïðèáûëè çàêðûâàòü ñäåëêó
//extern double PipStep = 30.0;       // øàã ìåæäó âûñòàâëåíèå íîâûõ êîëåí
extern double Drop = 500 ;
extern double RsiMinimum = 30.0 ;     // íèæíÿÿ ãðàíèöà RSI
extern double RsiMaximum = 70.0 ;     // âåðõíÿÿ ãðàíèöà RSI
extern int MagicNumber = 2222 ;       // âîëøåáíîå ÷èñëî (ïîìîãàåò ñîâåòíèêó îòëè÷èòü ñâîè ñòàâêè îò ÷óæèõ)
int PipStep= 0 ;
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
extern int MaxTrades = 10 ;                 // ìàêñèìàëüíî êîëè÷åñòâî îäíîâðåìåííî îòêðûòûõ îðäåðîâ
extern bool UseEquityStop = FALSE ;
extern double TotalEquityRisk = 20.0 ;
extern bool UseTrailingStop = FALSE ;
extern bool UseTimeOut = FALSE ;             // èñïîëüçîâàòü òàéìàóò (çàêðûâàòü ñäåëêè åñëè îíè "âèñÿò" ñëèøêîì äîëãî)
extern double MaxTradeOpenHours = 48.0 ;     // âðåìÿ òàéìàóòà ñäåëîê â ÷àñàõ (÷åðåç ñêîëüêî çàêðûâàòü çàâèñøèå ñäåëêè)
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
double PriceTarget, StartEquity, BuyTarget, SellTarget;
double AveragePrice, SellLimit, BuyLimit;
double LastBuyPrice, LastSellPrice, Spread;
bool flag;
string EAName= "Ilan1.6" ;
int timeprev = 0 , expiration;
int NumOfTrades = 0 ;
double iLots;
int cnt = 0 , total;
double Stopper = 0.0 ;
bool TradeNow = FALSE , LongTrade = FALSE , ShortTrade = FALSE ;
int ticket;
bool   NewOrdersPlaced = FALSE ;
double AccountEquityHighAmt, PrevEquity;
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
int init() {
   Spread = MarketInfo ( Symbol (), MODE_SPREAD ) * Point ;
   return ( 0 );
}

int deinit() {
   return ( 0 );
}
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
int start()
 {
 if (DynamicPips)  {
     double hival= High [ iHighest ( NULL , 0 , MODE_HIGH ,Glubina, 1 )];     // calculate highest and lowest price from last bar to 24 bars ago
     double loval= Low [ iLowest ( NULL , 0 , MODE_LOW ,Glubina, 1 )];       // chart used for symbol and time period
     PipStep= NormalizeDouble ((hival-loval)/DEL/ Point , 0 );         // calculate pips for spread between orders
     if (PipStep<DefaultPips/DEL) PipStep = NormalizeDouble (DefaultPips/DEL, 0 );
     if (PipStep>DefaultPips*DEL) PipStep = NormalizeDouble (DefaultPips*DEL, 0 );           // if dynamic pips fail, assign pips extreme value
   } // else PipStep = DefaultPips;
   //double filtr_MA = iMA(NULL,60,60,0,0,0,0);
   
   double PrevCl;
   double CurrCl;
   if (UseTrailingStop) TrailingAlls(TrailStart, TrailStop, AveragePrice);
   if (( iCCI ( NULL , 15 , 55 , 0 , 0 )>Drop && ShortTrade)||( iCCI ( NULL , 15 , 55 , 0 , 0 )<(-Drop) && LongTrade)) {
      
         CloseThisSymbolAll();
         Print ( "Closed All due to TimeOut" );
     
   }
   if (timeprev == Time [ 0 ]) return ( 0 );
   timeprev = Time [ 0 ];
   
   double CurrentPairProfit = CalculateProfit();
   if (UseEquityStop) {
       if (CurrentPairProfit < 0.0 && MathAbs (CurrentPairProfit) > TotalEquityRisk / 100.0 * AccountEquityHigh()) {
         CloseThisSymbolAll();
         Print ( "Closed All due to Stop Out" );
         NewOrdersPlaced = FALSE ;
      }
   }
   total = CountTrades();
   if (total == 0 ) flag = FALSE ;
   for (cnt = OrdersTotal () - 1 ; cnt >= 0 ; cnt--) {
       OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES );
       if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
       if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber) {
         if ( OrderType () == OP_BUY ) {
            LongTrade = TRUE ;
            ShortTrade = FALSE ;
             break ;
         }
      }
       if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber) {
         if ( OrderType () == OP_SELL ) {
            LongTrade = FALSE ;
            ShortTrade = TRUE ;
             break ;
         }
      }
   }
   if (total > 0 && total <= MaxTrades) {
       RefreshRates ();
      LastBuyPrice = FindLastBuyPrice();
      LastSellPrice = FindLastSellPrice();
       if (LongTrade && LastBuyPrice - Ask >= PipStep * Point ) TradeNow = TRUE ;
       if (ShortTrade && Bid - LastSellPrice >= PipStep * Point ) TradeNow = TRUE ;
   }
   if (total < 1 ) {
      ShortTrade = FALSE ;
      LongTrade = FALSE ;
      TradeNow = TRUE ;
      StartEquity = AccountEquity ();
   }
   if (TradeNow) {
      LastBuyPrice = FindLastBuyPrice();
      LastSellPrice = FindLastSellPrice();
       if (ShortTrade) {
         NumOfTrades = total;
         iLots = NormalizeDouble (Lots * MathPow (LotExponent, NumOfTrades), lotdecimal);
         RefreshRates ();
         ticket = OpenPendingOrder( 1 , iLots, Bid , slip, Ask , 0 , 0 , EAName + "-" + NumOfTrades + "-" + PipStep, MagicNumber, 0 , HotPink);
         if (ticket < 0 ) {
             Print ( "Error: " , GetLastError ());
             return ( 0 );
         }
         LastSellPrice = FindLastSellPrice();
         TradeNow = FALSE ;
         NewOrdersPlaced = TRUE ;
      } else {
         if (LongTrade) {
            NumOfTrades = total;
            iLots = NormalizeDouble (Lots * MathPow (LotExponent, NumOfTrades), lotdecimal);
            ticket = OpenPendingOrder( 0 , iLots, Ask , slip, Bid , 0 , 0 , EAName + "-" + NumOfTrades + "-" + PipStep, MagicNumber, 0 , Lime);
             if (ticket < 0 ) {
               Print ( "Error: " , GetLastError ());
               return ( 0 );
            }
            LastBuyPrice = FindLastBuyPrice();
            TradeNow = FALSE ;
            NewOrdersPlaced = TRUE ;
         }
      }
   }
   if (TradeNow && total < 1 ) {
      PrevCl = iClose ( Symbol (), 0 , 2 );
      CurrCl = iClose ( Symbol (), 0 , 1 );
      SellLimit = Bid ;
      BuyLimit = Ask ;
       if (!ShortTrade && !LongTrade) {
         NumOfTrades = total;
         iLots = NormalizeDouble (Lots * MathPow (LotExponent, NumOfTrades), lotdecimal);
         if (PrevCl > CurrCl) {
             if ( iRSI ( NULL , PERIOD_H1 , 14 , PRICE_CLOSE , 1 ) > RsiMinimum ) {
               ticket = OpenPendingOrder( 1 , iLots, SellLimit, slip, SellLimit, 0 , 0 , EAName + "-" + NumOfTrades, MagicNumber, 0 , HotPink);
               if (ticket < 0 ) {
                   Print ( "Error: " , GetLastError ());
                   return ( 0 );
               }
               LastBuyPrice = FindLastBuyPrice();
               NewOrdersPlaced = TRUE ;
            }
         } else {
             if ( iRSI ( NULL , PERIOD_H1 , 14 , PRICE_CLOSE , 1 ) < RsiMaximum ) {
               ticket = OpenPendingOrder( 0 , iLots, BuyLimit, slip, BuyLimit, 0 , 0 , EAName + "-" + NumOfTrades, MagicNumber, 0 , Lime);
               if (ticket < 0 ) {
                   Print ( "Error: " , GetLastError ());
                   return ( 0 );
               }
               LastSellPrice = FindLastSellPrice();
               NewOrdersPlaced = TRUE ;
            }
         }
         if (ticket > 0 ) expiration = TimeCurrent () + 60.0 * ( 60.0 * MaxTradeOpenHours);
         TradeNow = FALSE ;
      }
   }
   total = CountTrades();
   AveragePrice = 0 ;
   double Count = 0 ;
   for (cnt = OrdersTotal () - 1 ; cnt >= 0 ; cnt--) {
       OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES );
       if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
       if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber) {
         if ( OrderType () == OP_BUY || OrderType () == OP_SELL ) {
            AveragePrice += OrderOpenPrice () * OrderLots ();
            Count += OrderLots ();
         }
      }
   }
   if (total > 0 ) AveragePrice = NormalizeDouble (AveragePrice / Count, Digits );
   if (NewOrdersPlaced) {
       for (cnt = OrdersTotal () - 1 ; cnt >= 0 ; cnt--) {
         OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES );
         if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
         if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber) {
             if ( OrderType () == OP_BUY ) {
               PriceTarget = AveragePrice + TakeProfit * Point ;
               BuyTarget = PriceTarget;
               Stopper = AveragePrice - Stoploss * Point ;
               flag = TRUE ;
            }
         }
         if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber) {
             if ( OrderType () == OP_SELL ) {
               PriceTarget = AveragePrice - TakeProfit * Point ;
               SellTarget = PriceTarget;
               Stopper = AveragePrice + Stoploss * Point ;
               flag = TRUE ;
            }
         }
      }
   }
   if (NewOrdersPlaced) {
       if (flag == TRUE ) {
         for (cnt = OrdersTotal () - 1 ; cnt >= 0 ; cnt--) {
             OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES );
             if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
             if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber) OrderModify ( OrderTicket (), NormalizeDouble (AveragePrice, Digits ), NormalizeDouble ( OrderStopLoss (), Digits ), NormalizeDouble (PriceTarget, Digits ), 0 , Yellow);
            NewOrdersPlaced = FALSE ;
         }
      }
   }
   return ( 0 );
}
//ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí

int CountTrades() {
   int count = 0 ;
   for ( int trade = OrdersTotal () - 1 ; trade >= 0 ; trade--) {
       OrderSelect (trade, SELECT_BY_POS , MODE_TRADES );
       if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
       if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber)
         if ( OrderType () == OP_SELL || OrderType () == OP_BUY ) count++;
   }
   return (count);
}
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí

void CloseThisSymbolAll() {
   for ( int trade = OrdersTotal () - 1 ; trade >= 0 ; trade--) {
       OrderSelect (trade, SELECT_BY_POS , MODE_TRADES );
       if ( OrderSymbol () == Symbol ()) {
         if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber) {
             if ( OrderType () == OP_BUY ) OrderClose ( OrderTicket (), OrderLots (), Bid , slip, Blue);
             if ( OrderType () == OP_SELL ) OrderClose ( OrderTicket (), OrderLots (), Ask , slip, Red);
         }
         Sleep ( 1000 );
      }
   }
}

//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí

int OpenPendingOrder( int pType, double pLots, double pLevel, int sp, double pr, int sl, int tp, string pComment, int pMagic, int pDatetime, color pColor) {
   int ticket = 0 ;
   int err = 0 ;
   int c = 0 ;
   int NumberOfTries = 100 ;
   switch (pType) {
   case 2 :
       for (c = 0 ; c < NumberOfTries; c++) {
         ticket = OrderSend ( Symbol (), OP_BUYLIMIT , pLots, pLevel, sp, StopLong(pr, sl), TakeLong(pLevel, tp), pComment, pMagic, pDatetime, pColor);
         err = GetLastError ();
         if (err == 0 /* NO_ERROR */ ) break ;
         if (!(err == 4 /* SERVER_BUSY */ || err == 137 /* BROKER_BUSY */ || err == 146 /* TRADE_CONTEXT_BUSY */ || err == 136 /* OFF_QUOTES */ )) break ;
         Sleep ( 1000 );
      }
       break ;
   case 4 :
       for (c = 0 ; c < NumberOfTries; c++) {
         ticket = OrderSend ( Symbol (), OP_BUYSTOP , pLots, pLevel, sp, StopLong(pr, sl), TakeLong(pLevel, tp), pComment, pMagic, pDatetime, pColor);
         err = GetLastError ();
         if (err == 0 /* NO_ERROR */ ) break ;
         if (!(err == 4 /* SERVER_BUSY */ || err == 137 /* BROKER_BUSY */ || err == 146 /* TRADE_CONTEXT_BUSY */ || err == 136 /* OFF_QUOTES */ )) break ;
         Sleep ( 5000 );
      }
       break ;
   case 0 :
       for (c = 0 ; c < NumberOfTries; c++) {
         RefreshRates ();
         ticket = OrderSend ( Symbol (), OP_BUY , pLots, NormalizeDouble ( Ask , Digits ), sp, NormalizeDouble (StopLong( Bid , sl), Digits ), NormalizeDouble (TakeLong( Ask , tp), Digits ), pComment, pMagic, pDatetime, pColor);
         err = GetLastError ();
         if (err == 0 /* NO_ERROR */ ) break ;
         if (!(err == 4 /* SERVER_BUSY */ || err == 137 /* BROKER_BUSY */ || err == 146 /* TRADE_CONTEXT_BUSY */ || err == 136 /* OFF_QUOTES */ )) break ;
         Sleep ( 5000 );
      }
       break ;
   case 3 :
       for (c = 0 ; c < NumberOfTries; c++) {
         ticket = OrderSend ( Symbol (), OP_SELLLIMIT , pLots, pLevel, sp, StopShort(pr, sl), TakeShort(pLevel, tp), pComment, pMagic, pDatetime, pColor);
         err = GetLastError ();
         if (err == 0 /* NO_ERROR */ ) break ;
         if (!(err == 4 /* SERVER_BUSY */ || err == 137 /* BROKER_BUSY */ || err == 146 /* TRADE_CONTEXT_BUSY */ || err == 136 /* OFF_QUOTES */ )) break ;
         Sleep ( 5000 );
      }
       break ;
   case 5 :
       for (c = 0 ; c < NumberOfTries; c++) {
         ticket = OrderSend ( Symbol (), OP_SELLSTOP , pLots, pLevel, sp, StopShort(pr, sl), TakeShort(pLevel, tp), pComment, pMagic, pDatetime, pColor);
         err = GetLastError ();
         if (err == 0 /* NO_ERROR */ ) break ;
         if (!(err == 4 /* SERVER_BUSY */ || err == 137 /* BROKER_BUSY */ || err == 146 /* TRADE_CONTEXT_BUSY */ || err == 136 /* OFF_QUOTES */ )) break ;
         Sleep ( 5000 );
      }
       break ;
   case 1 :
       for (c = 0 ; c < NumberOfTries; c++) {
         ticket = OrderSend ( Symbol (), OP_SELL , pLots, NormalizeDouble ( Bid , Digits ), sp, NormalizeDouble (StopShort( Ask , sl), Digits ), NormalizeDouble (TakeShort( Bid , tp), Digits ), pComment, pMagic, pDatetime, pColor);
         err = GetLastError ();
         if (err == 0 /* NO_ERROR */ ) break ;
         if (!(err == 4 /* SERVER_BUSY */ || err == 137 /* BROKER_BUSY */ || err == 146 /* TRADE_CONTEXT_BUSY */ || err == 136 /* OFF_QUOTES */ )) break ;
         Sleep ( 5000 );
      }
   }
   return (ticket);
}
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
double StopLong( double price, int stop) {
   if (stop == 0 ) return ( 0 );
   else return (price - stop * Point );
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
double StopShort( double price, int stop) {
   if (stop == 0 ) return ( 0 );
   else return (price + stop * Point );
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
double TakeLong( double price, int stop) {
   if (stop == 0 ) return ( 0 );
   else return (price + stop * Point );
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
double TakeShort( double price, int stop) {
   if (stop == 0 ) return ( 0 );
   else return (price - stop * Point );
}
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
double CalculateProfit() {
   double Profit = 0 ;
   for (cnt = OrdersTotal () - 1 ; cnt >= 0 ; cnt--) {
       OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES );
       if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
       if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber)
         if ( OrderType () == OP_BUY || OrderType () == OP_SELL ) Profit += OrderProfit ();
   }
   return (Profit);
}
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
void TrailingAlls( int pType, int stop, double AvgPrice) {
   int profit;
   double stoptrade;
   double stopcal;
   if (stop != 0 ) {
       for ( int trade = OrdersTotal () - 1 ; trade >= 0 ; trade--) {
         if ( OrderSelect (trade, SELECT_BY_POS , MODE_TRADES )) {
             if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
             if ( OrderSymbol () == Symbol () || OrderMagicNumber () == MagicNumber) {
               if ( OrderType () == OP_BUY ) {
                  profit = NormalizeDouble (( Bid - AvgPrice) / Point , 0 );
                   if (profit < pType) continue ;
                  stoptrade = OrderStopLoss ();
                  stopcal = Bid - stop * Point ;
                   if (stoptrade == 0.0 || (stoptrade != 0.0 && stopcal > stoptrade)) OrderModify ( OrderTicket (), AvgPrice, stopcal, OrderTakeProfit (), 0 , Aqua);
               }
               if ( OrderType () == OP_SELL ) {
                  profit = NormalizeDouble ((AvgPrice - Ask ) / Point , 0 );
                   if (profit < pType) continue ;
                  stoptrade = OrderStopLoss ();
                  stopcal = Ask + stop * Point ;
                   if (stoptrade == 0.0 || (stoptrade != 0.0 && stopcal < stoptrade)) OrderModify ( OrderTicket (), AvgPrice, stopcal, OrderTakeProfit (), 0 , Red);
               }
            }
             Sleep ( 1000 );
         }
      }
   }
}
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí

double AccountEquityHigh() {
   if (CountTrades() == 0 ) AccountEquityHighAmt = AccountEquity ();
   if (AccountEquityHighAmt < PrevEquity) AccountEquityHighAmt = PrevEquity;
   else AccountEquityHighAmt = AccountEquity ();
   PrevEquity = AccountEquity ();
   return (AccountEquityHighAmt);
}
//íííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí

double FindLastBuyPrice() {
   double oldorderopenprice;
   int oldticketnumber;
   double unused = 0 ;
   int ticketnumber = 0 ;
   for ( int cnt = OrdersTotal () - 1 ; cnt >= 0 ; cnt--) {
       OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES );
       if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
       if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber && OrderType () == OP_BUY ) {
         oldticketnumber = OrderTicket ();
         if (oldticketnumber > ticketnumber) {
            oldorderopenprice = OrderOpenPrice ();
            unused = oldorderopenprice;
            ticketnumber = oldticketnumber;
         }
      }
   }
   return (oldorderopenprice);
}

double FindLastSellPrice() {
   double oldorderopenprice;
   int oldticketnumber;
   double unused = 0 ;
   int ticketnumber = 0 ;
   for ( int cnt = OrdersTotal () - 1 ; cnt >= 0 ; cnt--) {
       OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES );
       if ( OrderSymbol () != Symbol () || OrderMagicNumber () != MagicNumber) continue ;
       if ( OrderSymbol () == Symbol () && OrderMagicNumber () == MagicNumber && OrderType () == OP_SELL ) {
         oldticketnumber = OrderTicket ();
         if (oldticketnumber > ticketnumber) {
            oldorderopenprice = OrderOpenPrice ();
            unused = oldorderopenprice;
            ticketnumber = oldticketnumber;
         }
      }
   }
   return (oldorderopenprice);
}
//ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
 

Por favor, alguém poderia ser gentil o suficiente para ajudar a adicionar a este indicador a opção de janela?

Eu não sei nada sobre codificação!


Obrigado de antemão Max

Arquivos anexados:
true_trend.mq4  32 kb
 

Hi!

Estou procurando que a Mostra de Tendências da Lawgirl mostre a direção dos estochásticos ao invés do rsi. Alguém pode fazer isso?

Arquivos anexados:
 

Hi, ...
por favor, transforme o indicador em um simples EA apenas para Posições Fechadas, a linha de Fibo é apenas para posições abertas fechadas (Posições Fechadas com Lucro apenas) em cada toque na linha de Fibo...
OP com manualy

Obrigado de antemão

Arquivos anexados:
 
Forexpaco: Eu gostaria de acrescentar
Você tem apenas quatro opções: Não vamos codificá-lo para você (embora isso possa acontecer se você tiver sorte ou se o problema for interessante.) Estamos dispostos a ajudá-lo quando você apresentar sua tentativa (usandoSRC) e a natureza de seu problema.
Nenhuma ajuda gratuita
ajuda urgente.
 

Hi

Preciso de ajuda se alguém puder codificar isto como um indicador.

as regras são assim:

1. Uso para H1 acima, mas altamente recomendado para H4

2. O Indicador notificará com alerta quando houver Vela em alta quebra alta Vela em baixa antes ou Vela em baixa quebra alta Vela em alta Vela em baixa Vela em alta antes de pelo menos 1 pip

3. precisam também da capacidade deenviar notificação para o telefone de mão.


Obrigado por sua gentileza