ADX problems

스크립트 다른

작업 종료됨

실행 시간 14 시간
고객의 피드백
Eric is a great programmer and he helps you to understand code after his work.
피고용인의 피드백
Great customer, look forward to working with again.

명시

Hi! I have problems with me code. I need somebody help me with that. Thank you

extern double lots = 1;           
extern double CCIsell = 100;
extern double CCIbuy = -100;
extern double CCIclose = 100;
extern double slippage = 0;
extern int CCIperiod = 14;
extern double ADXlimit = 25;
extern int ADX = 14;
extern string nameEA = "B3";
int c, ticket;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//Variables Initialization//
int positions = 0;  
//Scanning//
for(c = 0; c < OrdersTotal(); c++)
   {       
//Checking open market trades//
    OrderSelect(c, SELECT_BY_POS);
//Looking only for this symbol and orders from this EA//       
      if(OrderSymbol() == Symbol() && OrderType() <= OP_SELL && OrderComment() == nameEA)
        {  
         positions++;
//Checking for close signal for bought trade//
         if(OrderType() == OP_BUY)            
           {
           if(iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 0) >= CCIclose)
             {
              //Close bought trade//
              OrderClose(OrderTicket(), OrderLots(), Bid, slippage, CLR_NONE);  
             } 
           }   
//Checking for close signal for sold trade//
         else
           {
           if(iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 0) <= -CCIclose)
             {
             //Close sold trade//
              OrderClose(OrderTicket(), OrderLots(), Ask, slippage, CLR_NONE);
             }
           }
        }
   }
//If there is no open trade for this pair and this EA//
if(positions < 1)
   {  
      if(AccountFreeMargin() < 1000*lots)
         {
           Print("Not enough money to trade ", lots, " lots. Strategy:", nameEA);
           return(0);
         }
     
   //Checking buy signal//
      if(iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 0) <= CCIbuy)
         { 
              if( (iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 0) < iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 1)) &&
              ( (iADX(NULL, 0, ADX, PRICE_OPEN, MODE_MAIN, 0) >= ADXlimit) || (iADX(NULL, 0, ADX, PRICE_OPEN, MODE_MINUSDI, 0) >= ADXlimit)))
                 
                 //Sell//
                 ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, slippage, 0, 0, nameEA, 0, 0, CLR_NONE);
               
              else
                
                 //Buy//
                 ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, slippage, 0, 0, nameEA, 0, 0, CLR_NONE); 
               
              if(ticket < 0)
              Print("OrderSend(",nameEA,") ERROR #", GetLastError());
               
                                 
         }
      
      //Checking sell signal//
      if(iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 0) >= CCIsell)
         {
              if( (iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 0) > iCCI(NULL, 0, CCIperiod, PRICE_OPEN, 1)) &&
              ( (iADX(NULL, 0, ADX, PRICE_OPEN, MODE_MAIN, 0) >= ADXlimit) || (iADX(NULL, 0, ADX, PRICE_OPEN, MODE_PLUSDI, 0) >= ADXlimit)))
                               
                //Buy//
                ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, slippage, 0, 0, nameEA, 0, 0, CLR_NONE); 
                
            else       
                //Sell//
                ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, slippage, 0, 0, nameEA, 0, 0, CLR_NONE); 
                   
              if(ticket < 0)
               Print("OrderSend(",nameEA,") ERROR #", GetLastError()); 
                    
         }
           
   }   
   return(0);

응답함

1
개발자 1
등급
(273)
프로젝트
396
63%
중재
70
53% / 26%
기한 초과
198
50%
무료
비슷한 주문
I'm seeking an experienced MQL5 developer to create a robust Expert Advisor (EA) that integrates 4 powerful strategies into a single, cohesive system. The EA will trade XAUUSD exclusively and adhere to strict risk management principles, avoiding grid and martingale techniques. *Strategy Overview* The EA will incorporate the following strategies, each with its own unique approach: 1. *High Timeframe Trend Reversal*
I have developed a cloud-based AI copier that automatically replicates analyzed signals from any linked channel directly to your platform. Streamline your workflow with precision automation and real-time execution. Boost your efficiency and never miss a critical trade or update again. Reach out now to integrate this powerful tool
I am looking for someone to test my mt5 utility software and write a comment and review about the functionality. The program I need tested ingests data into mt5. MML Data Bridge | Buy Trading Utility for MetaTrader 5 The project consists of purchasing the utility from the marketplace ($30 - project pays $60 to cover cost of purchase), downloading the utility, following the user set up instructions and testing its
Hi, I’m searching for a developer who already has a high‑performance Gold EA that can beat the results shown in my screenshot. If you have such an EA, please reply with: - A brief description of how it works (grid, scalping, SMC, etc.) - Backtest results and the set files you used - Whether you’re willing to make minor tweaks so I can use it as my own If the performance looks good, we can discuss adjustments and next
Hello everyone, I’m looking to develop a custom optimization criterion for my EA based on a Supertrend clustering and I’m seeking a freelance developer who can implement this for MT5. The goal is to identify parameter sets that are the most profitable, consistent, and well controlled (DD). My focus is on robustness, stable performance, and realistic drawdown behavior. I have already created custom criterions (such as
I need a MetaTrader 5 Expert Advisor based on SMA 5/9 crossover: - Only one position at a time. - Close & reverse on opposite SMA cross. - No trading on very large breakout candles. - Stop Loss mandatory, 20-50 pips. - Manual lot size and manual timeframe. - EA must be clean, optimized, stable for Gold and Forex. Attached file contains full EA specification for development
Hi, I'm looking for an experienced programmer that is able to implement a license verification tool on my PHP website. Here is how it will mainly work. After payment, the customer can install the EX4 file on a specific number of PC's. Everything will be automated meaning that once the customer pays for a product on my website, he gets a verification key that will work on the EX4 file. Or if you already have an
Hello, How are you doing? I need someoene who is familiar with Blockchain. I have a stable coins i used for betting, I will need to create a gaming token. I need a developer who can design and develop a game token that integrates seamlessly with my existing frontend application built in React. Kindly bid if this is what you can do. Thanks
Hello, How are you doing? i need a developer who can help me work on my FXDreema project. I did an extensive back testing and come up with an edge wich i would like to automate, it's a mechanical strategy that waits for a session sweep, wait for certain confluences and then a 5min FVG. Kindly bid if this is what you can do. Thanks
Hello, How are you doing? i need a developer who can help me work on my FXDreema project. I did an extensive back testing and come up with an edge wich i would like to automate, it's a mechanical strategy that waits for a session sweep, wait for certain confluences and then a 5min FVG. Kindly bid if this is what you can do. Thanks

프로젝트 정보

예산
10 USD
기한
 1 일