ADX problems

Skripte Sonstiges

Auftrag beendet

Ausführungszeit 14 Stunden
Bewertung des Kunden
Eric is a great programmer and he helps you to understand code after his work.
Bewertung des Entwicklers
Great customer, look forward to working with again.

Spezifikation

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

Bewerbungen

1
Entwickler 1
Bewertung
(272)
Projekte
394
63%
Schlichtung
70
53% / 26%
Frist nicht eingehalten
198
50%
Frei
Ähnliche Aufträge
Hello i need an expert who can help me modify an open source PineScript indicator code to add additional features. ONLY EXPERT WITH PROVE OF WORK SHOULD CONTACT FOR FURTHER DISCUSSION ON THE PROJECT
I'm looking to take my Tradingview Indicator and convert it to be used on Ninja Trader 8. I will be the only one using it and will not be made public, but I want to use it so I can trade using it live and also in replaying past data on NT8. Its just an indicator that places certain Goldbach lines on the chart based on a selection in the menu. So, its not a Bot, but an indicator. I have attached the script below so
Create script to move multiple take profits (from multiple trades) at one time. Typically for a single currency pair Summary: There are multiple trades in 1 currency pair There are multiple take profits, 1 for each trade I want a script to be built to modify all the take profits at one time There may be up to 20 take profits, from 20 different trades that I want to be able to move/adjust all at one time, very easily
Hi there - Overview We are seeking an experienced developer to create a Forex Robot Expert Advisor (EA) tailored to specific trading strategies and conditions. The EA will focus on the London trading session and will automate trades based on pre-defined calculations and market movements. *Responsibilities:* 1. *London Session Analysis:* - Develop functionality to highlight the London trading session on the forex
Dear Freelancers, I'm seeking a skilled MT4/MT5 developer to collaborate on a valuable trading indicator. Project Description: I'm looking to develop a powerful Elliott Wave indicator compatible with the MT4 and MT5 trading platforms. This indicator will be based on the highly successful [LuxAlgo] indicator currently available on TradingView. Key Features: In-indicator Alerts: The ability to receive pop-up
Profit EA 50+ USD
//+------------------------------------------------------------------+ //| SimpleEA.mq4 | //| Generated by MetaEditor | //| https://www.mql5.com/en/docs&nbsp ; | //+------------------------------------------------------------------+ #property strict // Input parameters input double LotSize = 0.1; // Lot size input int MovingAveragePeriod = 50; // MA
I want to find a Developer to perform this work and settle payments in this Application. I undertake not to communicate with Applicants anywhere else except this Application, including third-party messengers, personal correspondence or emails. I understand that violators will be banned from publishing Orders in the Freelance service. I have read the Rules of using the Freelance service and accept them. I agree

Projektdetails

Budget
10 USD
Für die Entwickler
9 - 9 USD
Ausführungsfristen
bis 1 Tag(e)