TOROS EA

MQL4 Uzmanlar

İş tamamlandı

Tamamlanma süresi: 2 gün
Geliştirici tarafından geri bildirim
very good client,pleasure to work with

Şartname

#include <Trade\Trade.mqh> // Get code from other places

//--- Input Variables (Accessible from MetaTrader 5)

input double   lot = 0.01;
input int      slippage = 3;
input bool     useStopLoss = true;
input double   stopLossPips = 100;
input bool     useTakeProfit = true;
input double   takeProfitPips = 300;
input int      MAperiodShort=5;
input int      DonchianPeriod=100;   
input int      InverseFisherPeriodsshort=40;
input bool     useTrailingStop=true;                                   
input double   trailingStopPips=40;


//--- Service Variables (Only accessible from the MetaEditor)

CTrade myTradingControlPanel;

double  MaDataShort[];
int     MaControlPanelShort;
double  numberofMaDataShort;
double  MaDataShort1,MaDataShort2,MaDataShort3;

double DonchianDataHigh[],DonchianDataLow[];
int   DonchianControlPanel;
double numberofDonchianDataHigh,numberofDonchianDataLow;
double DonchianDataHigh1,DonchianDataHigh2,DonchianDataHigh3;
double DonchianDataLow1,DonchianDataLow2,DonchianDataLow3;

int P;
double currentBid, currentAsk;
double stopLossPipsFinal, takeProfitPipsFinal, stopLevelPips;
double stopLossLevel, takeProfitLevel;

int    inverseFisherTransformPanelshort;
string ehlers_inverse_fisher_transform_2short;
double inverseFisherDatashort1[],inverseFisherDatashort2[];
double   eInverseFisherDataNormalizeshort1, eInverseFisherDataNormalizeshort2;
int  numberofInverseFisherDatashort1,numberofInverseFisherDatashort2;

double DS;


double newStopLossPips; 
double newTrailingStopPrice;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
 
  
   ArraySetAsSeries(MaDataShort,true);
   MaControlPanelShort =iMA(_Symbol,_Period,MAperiodShort,0,MODE_SMA,PRICE_CLOSE);
    
  
   ArraySetAsSeries(inverseFisherDatashort1,true);  
   ArraySetAsSeries(inverseFisherDatashort2,true);  
   inverseFisherTransformPanelshort = iCustom(_Symbol,_Period,"ehlers_inverse_fisher_transform_2",InverseFisherPeriodsshort);
   
   ArraySetAsSeries(DonchianDataHigh,true);
    ArraySetAsSeries(DonchianDataLow,true);
   DonchianControlPanel=iCustom(_Symbol,_Period,"donchian_channel",DonchianPeriod);
   
   
   
   
   if(_Digits == 5 || _Digits == 3 || _Digits == 1) P = 10;else P = 1; // To account for 5 digit brokers
   
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
   IndicatorRelease(MaControlPanelShort);
   IndicatorRelease(DonchianControlPanel);
   IndicatorRelease(inverseFisherTransformPanelshort);
   
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   // -------------------- Collect most current data --------------------
   
   currentBid = SymbolInfoDouble(_Symbol,SYMBOL_BID); // Get latest Bid Price
   currentAsk = SymbolInfoDouble(_Symbol,SYMBOL_ASK); // Get latest Ask Price
   
  
   
   numberofMaDataShort=CopyBuffer(MaControlPanelShort,0,0,5,MaDataShort);
   
   MaDataShort1=MaDataShort[1];
   MaDataShort2=MaDataShort[2];
   MaDataShort3=MaDataShort[3];
   
   numberofDonchianDataHigh=CopyBuffer(DonchianControlPanel,0,0,5,DonchianDataHigh);
   numberofDonchianDataLow=CopyBuffer(DonchianControlPanel,1,0,5,DonchianDataLow);
   DonchianDataHigh1=DonchianDataHigh[1];
   DonchianDataHigh2=DonchianDataHigh[2];
   DonchianDataHigh3=DonchianDataHigh[3];
   
   DonchianDataLow1=DonchianDataLow[1];
   DonchianDataLow2=DonchianDataLow[2];
   DonchianDataLow3=DonchianDataLow[3];
   
   
   numberofInverseFisherDatashort1 =CopyBuffer(inverseFisherTransformPanelshort,0,0,3,inverseFisherDatashort1);
   numberofInverseFisherDatashort2 = CopyBuffer(inverseFisherTransformPanelshort,0,0,3,inverseFisherDatashort2);
   
   
   eInverseFisherDataNormalizeshort1=NormalizeDouble(inverseFisherDatashort1[1],3);
   eInverseFisherDataNormalizeshort2=NormalizeDouble(inverseFisherDatashort2[2],3);
  
  DS=DonchianDataHigh1/DonchianDataLow1;
  
  
   // -------------------- Technical Requirements --------------------
   
   // Explanation: Stop Loss and Take Profit levels can't be too close to our order execution price. We will talk about this again in a later lecture.
   // Resources for learning more: https://book.mql4.com/trading/orders (ctrl-f search "stoplevel"); https://book.mql4.com/appendix/limits
   
   stopLevelPips = (double) (SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) + SymbolInfoInteger(_Symbol, SYMBOL_SPREAD)) / P; // Defining minimum StopLevel

   if (stopLossPips < stopLevelPips) 
      {
      stopLossPipsFinal = stopLevelPips;
      } 
   else
      {
      stopLossPipsFinal = stopLossPips;
      } 
      
   if (takeProfitPips < stopLevelPips) 
      {
      takeProfitPipsFinal = stopLevelPips;
      }
   else
      {
      takeProfitPipsFinal = takeProfitPips;
      }
      
  // -------------------- EXITS --------------------
   
   if(PositionSelect(_Symbol) == true) // We have an open position
      { 
      
      // --- Exit Rules (Long Trades) ---
      
      /*
      Exits:
      - Exit the long trade when SMA(10) crosses SMA(40) from top
      - Exit the short trade when SMA(10) crosses SMA(40) from bottom
      */
      
      // TDL 3: Enter exit rule for long trades
      
        if (DonchianDataLow1<DonchianDataLow2&&
         eInverseFisherDataNormalizeshort1<eInverseFisherDataNormalizeshort2)
         {
         if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY) // If it is Buy position
            { 
            
            myTradingControlPanel.PositionClose(_Symbol); // Closes position related to this symbol
            
            if(myTradingControlPanel.ResultRetcode()==10008 || myTradingControlPanel.ResultRetcode()==10009) //Request is completed or order placed
               {
               Print("Exit rules: A close order has been successfully placed with Ticket#: ",myTradingControlPanel.ResultOrder());
               }
            else
               {
               Print("Exit rules: The close order request could not be completed.Error: ",GetLastError());
               ResetLastError();
               return;
               }
               
            }
         }
      
      // TDL 4: Enter exit rule for short trades
      
      // --------------------------------------------------------- //
      // --------------------------------------------------------- //  
      if  (DonchianDataHigh1>DonchianDataHigh2&&
      eInverseFisherDataNormalizeshort1>eInverseFisherDataNormalizeshort2)
       
         if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) // If it is Sell position
            { 
            
            myTradingControlPanel.PositionClose(_Symbol); // Closes position related to this symbol
            
            if(myTradingControlPanel.ResultRetcode()==10008 || myTradingControlPanel.ResultRetcode()==10009) //Request is completed or order placed
               {
               Print("Exit rules: A close order has been successfully placed with Ticket#: ", myTradingControlPanel.ResultOrder());
               }
            else
               {
               Print("Exit rules: The close order request could not be completed. Error: ", GetLastError());
               ResetLastError();
               return;
               }
            }
         }
      
       if(useTrailingStop==true)
        {
         if(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
           {
            newTrailingStopPrice = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_BID) - trailingStopPips*(_Point*P), _Digits);
            if(newTrailingStopPrice > PositionGetDouble(POSITION_PRICE_OPEN))
              { //if price has moved in favour of trade by more than trailingStopPips
               if(newTrailingStopPrice > PositionGetDouble(POSITION_SL))
                 { //if existing SL is not as tight as newTrailingStopPrice
                  myTradingControlPanel.PositionModify(_Symbol, newTrailingStopPrice, PositionGetDouble(POSITION_TP));
                  Print("Trailing Stop has moved to ", newTrailingStopPrice);
                 }
              }
           }
         if(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
           {
            newTrailingStopPrice = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_ASK) + trailingStopPips*(_Point*P), _Digits);
            if(newTrailingStopPrice < PositionGetDouble(POSITION_PRICE_OPEN))
              { //if price has moved in favour of trade by more than trailingStopPips
               if(newTrailingStopPrice < PositionGetDouble(POSITION_SL) || PositionGetDouble(POSITION_SL) == 0)
                 { //if existing SL is not as tight as newTrailingStopPrice
                  myTradingControlPanel.PositionModify(_Symbol, newTrailingStopPrice, PositionGetDouble(POSITION_TP));
                  Print("Trailing Stop has moved to ", newTrailingStopPrice);
                 }
              }
           }
        }
      
   
   // -------------------- ENTRIES --------------------  
         
   if(PositionSelect(_Symbol) == false) // We have no open position
      { 
      
      // --- Entry Rules (Long Trades) ---
      
      /*
      Entries:
      - Enter a long trade when SMA(10) crosses SMA(40) from bottom
      - Enter a short trade when SMA(10) crosses SMA(40) from top
      */
      
      // TDL 1: Enter entry rule for long trades
      
      // --------------------------------------------------------- //
      
        if  (DonchianDataHigh1>DonchianDataHigh2&&MaDataShort1>MaDataShort2
        &&DonchianDataLow1>=DonchianDataLow2&&eInverseFisherDataNormalizeshort1>eInverseFisherDataNormalizeshort2&&DS>1.0097)
       // &&eInverseFisherDataNormalizeshort1>eInverseFisherDataNormalizeshort2&&
        //eInverseFisherDataNormalizeshort1>0&&eInverseFisherDataNormalizeshort2>0)
         
      
         {   
         
         if (useStopLoss) stopLossLevel = currentAsk - stopLossPipsFinal * _Point * P; else stopLossLevel = 0.0;
         if (useTakeProfit) takeProfitLevel = currentAsk + takeProfitPipsFinal * _Point * P; else takeProfitLevel = 0.0;
        
         myTradingControlPanel.PositionOpen(_Symbol, ORDER_TYPE_BUY, lot, currentAsk, stopLossLevel, takeProfitLevel, "Buy Trade. Magic Number #" + (string) myTradingControlPanel.RequestMagic()); // Open a Buy position
         
         if(myTradingControlPanel.ResultRetcode()==10008 || myTradingControlPanel.ResultRetcode()==10009) //Request is completed or order placed
            {
            Print("Entry rules: A Buy order has been successfully placed with Ticket#: ", myTradingControlPanel.ResultOrder());
            }
         else
            {
            Print("Entry rules: The Buy order request could not be completed. Error: ", GetLastError());
            ResetLastError();
            return;
            }
           
         }
         
      // --- Entry Rules (Short Trades) ---
      
      /*
      Exit:
      - Exit the long trade when SMA(10) crosses SMA(40) from top
      - Exit the short trade when SMA(10) crosses SMA(40) from bottom
      */
      
      // TDL 2: Enter entry rule for short trades
      
      // --------------------------------------------------------- //
      
      else if  (DonchianDataLow1<DonchianDataLow2&&MaDataShort1<MaDataShort2
      &&DonchianDataHigh1<=DonchianDataHigh2&&eInverseFisherDataNormalizeshort1<eInverseFisherDataNormalizeshort2&&DS>1.0097)
     // &&eInverseFisherDataNormalizeshort1<eInverseFisherDataNormalizeshort2&&
       //       eInverseFisherDataNormalizeshort1<0&&eInverseFisherDataNormalizeshort2<0)
               
     
      
         {   
         
         if (useStopLoss) stopLossLevel = currentBid + stopLossPipsFinal * _Point * P; else stopLossLevel = 0.0;
         if (useTakeProfit) takeProfitLevel = currentBid - takeProfitPipsFinal * _Point * P; else takeProfitLevel = 0.0;

         myTradingControlPanel.PositionOpen(_Symbol, ORDER_TYPE_SELL, lot, currentBid, stopLossLevel, takeProfitLevel, "Sell Trade. Magic Number #" + (string) myTradingControlPanel.RequestMagic()); // Open a Sell position
         
         if(myTradingControlPanel.ResultRetcode()==10008 || myTradingControlPanel.ResultRetcode()==10009) //Request is completed or order placed
            {
            Print("Entry rules: A Sell order has been successfully placed with Ticket#: ", myTradingControlPanel.ResultOrder());
            }
         else
            {
            Print("Entry rules: The Sell order request could not be completed.Error: ", GetLastError());
            ResetLastError();
            return;
            }
         
         } 
      
      }
   
   } 
   
   
   
   
   
   
   
   
   
   
   
   



//+------------------------------------------------------------------+

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(111)
Projeler
139
43%
Arabuluculuk
9
33% / 44%
Süresi dolmuş
6
4%
Serbest
2
Geliştirici 2
Derecelendirme
(4)
Projeler
4
0%
Arabuluculuk
1
0% / 0%
Süresi dolmuş
0
Serbest
Benzer siparişler
A robot 30+ USD
Je souhaite trouver un développeur pour réaliser ce travail et effectuer les paiements via cette application. Je m'engage à ne communiquer avec les candidats que par cette application, y compris par messageries tierces, correspondance personnelle ou courriel. Je comprends que toute personne ne respectant pas ces conditions sera interdite de publier des commandes sur la plateforme Freelance
I am looking for an experienced MQL5/MT5 developer to develop a custom Expert Advisor based on a complete technical architecture already prepared by the client. This is not a request to design a trading strategy from scratch . The strategy architecture, entry/exit concepts, filters, risk-management requirements and testing requirements are already documented. The main responsibility will be MQL5 development
EAs 100+ USD
To apply, you must already have your EA running on an active MT5 trading account connected to the market. The account must have genuine trading history that can be independently reviewed and verified. EA Requirements 1. Prop-Firm Compatible Risk Management - The EA must include daily and overall drawdown protection. - Required inputs: "MaxDailyLoss = 5%" "MaxTotalDrawdown = 10%" - Once either limit is
Strategy 40 - 60 USD
yo i have a strategy i would really like to turn into a signal bot basically please this is very technical and serious to me the strategy needs more time 1 time frame and the bot most be 100% accurate
Ready to use bot 100+ USD
seller must provide the following to be considered... i will answer to all who fit this description, and can purchase more than 1 EA... - brief strategy description - overall EA expectancy - 1 week limited trial version, with whatever settings you consider best (can be blocked on demo, i don't really care) - investor password from a reputable broker (if history is available... live / demo, same thing, doesn't really
I want you to develop a professional HFT trading robot for MT5/MQL5 , initially focused on XAUUSD . The robot should be designed for high-speed tick-level trading , analyzing real-time bid/ask movement, spread, tick velocity, momentum, volatility, price acceleration and short-term market microstructure to identify very short-term opportunities. The core strategy should be capable of opening 5–10+ positions in a
can you help me use a Tickblaze Algo NRBO on the NT platform? I have it somewhat set up, but I have other questions about running it & knowing how to operate it in NT. Thank you if anyone have experience in this kindly bib and let do it asap
I need a fully automated custom Expert Advisor for MetaTrader 5 (MQL5). The EA is intended for use on a The5ers $100,000 2-Step prop-firm account. IMPORTANT DELIVERY REQUIREMENT: I must receive the complete editable .mq5 source code as well as the compiled .ex5 file. Compiled-only delivery is NOT acceptable. The EA must be coded specifically for this project and must not copy trades, use external trading signals or
I've got a Pine Script from Trading View. I need help from a programmer who can help with optimising the strategy by 1) Adding a couple of further rules 2) Redesign the trading alert arrows & colours I need, please, a programmer who is 1) Good at Pine language 2) Has excellent after-job support (not for free though) 3) Possess the ability to work with others. 4) Able to deliver the job at the shortest possible time
I need an experienced TradingView Pine Script developer to build and test a custom intraday strategy for NQ/MNQ . I am not looking for a conversion . I need the strategy researched, developed, tested, and optimized based on my requirements. Requirements: NQ/MNQ intraday trading 5–15 minute charts New York session only Flat before market close Base logic using Zero Lag Signals , with additional filters if justified

Proje bilgisi

Bütçe
30+ USD