ADX problems

Scripts Autre

Tâche terminée

Temps d'exécution 14 heures
Commentaires du client
Eric is a great programmer and he helps you to understand code after his work.
Commentaires de l'employé
Great customer, look forward to working with again.

Spécifications

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);

Répondu

1
Développeur 1
Évaluation
(273)
Projets
396
63%
Arbitrage
70
53% / 26%
En retard
198
50%
Gratuit
Commandes similaires
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
I have an indicator i need automated i use it manually and it plots arrows. Can you automate it for my Ninjatrader8? Do you need to see file? Expert Ninjatrader Developer can Bid for this project
I am seeking a highly experienced MT4/MT5 developer to analyze my trade history and replicate the trading strategy into a new Expert Advisor. The developer must have proven experience in strategy reverse-engineering, trade data analysis, and EA development across various trading methodologies. Strong familiarity with EURUSD trading behavior and chart analysis is essential. Please keep on mind we don't have physical
🔥 Premium Trading Website for Sale – NeuroTraderX.com (Ready-Made Signal Business) NeuroTraderX.com is a professionally branded, fully functional trading website designed specifically for Forex / Crypto / Indices traders, signal providers, and prop-firm traders who want to monetize their trading immediately without building everything from scratch. This is not just a website — it’s a complete trading business
Hi, I need a StrategyQuant X template built for index trading. The template must include: 1. Session and Time Filters The strategy must only trade inside fixed GMT sessions for each index. These sessions must be converted to broker server time and stay correct when the broker switches between summer and winter time. The template also needs optional delay blocks around market opens, a lunch window filter, and simple
IF you are a successful trader with a scalping method on M1 - M5 and you are able to teach me your strategy without dangerous strategy like Martingale, Grid trading, even hedging without High Frequency Trades [means minimun duration is > 2 minutes with number of lot less than 20 WITH proof of this skill by showing a PDF [or HTML] report produce directly by MT4 or MT5 ===> NOTE THAT WITHOUT THIS LIST OF TRADE FROM
Hello traders , i have an excellent market structure forecaster , a tool that informs traders of the coming trends or ranging markets before they happen. try it out for yourself. https://www.mql5.com/en/users/lawrencemkandaw/seller
I am looking for long-term partners interested in developing and scaling automated trading solutions and financial software projects. I contribute strong experience in MQL4/MQL5 development, strategy automation, and system optimization . Open to professional and transparent collaborations
Specification Revised Project Description We need a MetaTrader 4/5 Expert Advisor that lets you (the master trader) broadcast every trade to all of your client accounts in real time. The solution must work across the entire country, so it should use a MetaQuotes ID link (or any other method the developer recommends) to identify the master account and allow unlimited clients to subscribe. *Key Requirements* -

Informations sur le projet

Budget
10 USD
Délais
à 1 jour(s)