Hi, I need someone who can create an EA that trades by RSI divergence (Zigzag included preferred)

仕事が完了した

実行時間10 日
依頼者からのフィードバック
Hooman is a great programmer, he is patient and professional, will work with him again in the future.
開発者からのフィードバック
He is so responsible and I had a good job I hope to work with you in another job.

指定

Hi, I am trying to create an EA that trades by RSI divergence, I tried coding it as below but when I run it in backtest, the backtest ends in less than a second. I would like a functional EA based on this code that all I need was to change the numerical parameters to make it work for me. My trade logic is simple, I would like to be able to trend when the latest PeakPrice > last PeakPrice (note: latest doesn't have to be current, but last means the one before the latest) && rsi(latest_peak)<rsi(last_peak) and when the latest TroughPrice< last TroughPrice && rsi(latest_trough)>rsi(last_trough). It would be great if you can include Zigzag in finding the Peak and Trough. Attached is the technical indicators I would like my EA to base on (it didn't include a Zigzag though).

//+------------------------------------------------------------------+
//|                                                       RSI EA.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                           http://free-bonus-deposit.blogspot.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, dXerof"
#property link      "http://free-bonus-deposit.blogspot.com"
#property version   "1.00"
#property strict

#define arrowsDisplacement 0.0003

input bool   OpenBUY=True;
input bool   OpenSELL=True;
input bool   CloseBySignal=True;
input double StopLoss=0;
input double TakeProfit=0;
input double TrailingStop=0;
input int    RSIperiod=14;
input double BuyLevel=30;
input double SellLevel=70;
input bool   AutoLot=True;
input double Risk=1;
input double ManualLots=0.1;
input int    MagicNumber=123;
input string Koment="RSIea";
input int    Slippage=10;

input ENUM_APPLIED_PRICE    RSI_applied_price                = 0;

//---- buffers

double rsi[];


//----

//---
int OrderBuy,OrderSell;
int ticket;
int LotDigits;

double Trail,iTrailingStop;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {

   double stoplevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   OrderBuy=0;
   OrderSell=0;
   for(int cnt=0; cnt<OrdersTotal(); cnt++)
     {
      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && OrderComment()==Koment)
           {
            if(OrderType()==OP_BUY) OrderBuy++;
            if(OrderType()==OP_SELL) OrderSell++;
            if(TrailingStop>0)
              {
               iTrailingStop=TrailingStop;
               if(TrailingStop<stoplevel) iTrailingStop=stoplevel;
               Trail=iTrailingStop*Point;
               double tsbuy=NormalizeDouble(Bid-Trail,Digits);
               double tssell=NormalizeDouble(Ask+Trail,Digits);
               if(OrderType()==OP_BUY && Bid-OrderOpenPrice()>Trail && Bid-OrderStopLoss()>Trail)
                 {
                  ticket=OrderModify(OrderTicket(),OrderOpenPrice(),tsbuy,OrderTakeProfit(),0,Blue);
                 }
               if(OrderType()==OP_SELL && OrderOpenPrice()-Ask>Trail && (OrderStopLoss()-Ask>Trail || OrderStopLoss()==0))
                 {
                  ticket=OrderModify(OrderTicket(),OrderOpenPrice(),tssell,OrderTakeProfit(),0,Blue);
                 }
              }
           }
     }
   double rsim1=iRSI(Symbol(),1,RSIperiod,PRICE_CLOSE,1);
   double rsim5=iRSI(Symbol(),5,RSIperiod,PRICE_CLOSE,1);
   double rsim15=iRSI(Symbol(),15,RSIperiod,PRICE_CLOSE,1);
   double rsim30=iRSI(Symbol(),30,RSIperiod,PRICE_CLOSE,1);
   double rsim60=iRSI(Symbol(),60,RSIperiod,PRICE_CLOSE,1);
   double rsid1=iRSI(Symbol(),1440,RSIperiod,PRICE_CLOSE,0);
   double rsid2=iRSI(Symbol(),1440,RSIperiod,PRICE_CLOSE,1);
// double HTb=iCustom(Symbol(),0,"HalfTrend-1.02",0,0); //buy
// double HTs=iCustom(Symbol(),0,"HalfTrend-1.02",1,0); //buy
//--- open position
   int shift=4;
   if(IsTrough(shift) == true) 
   {
    int currentTrough = shift;
    int lastTrough = GetLastTrough(shift);
    if(OpenBUY && OrderBuy<3 && rsi[currentTrough] > rsi[lastTrough] && Low[currentTrough] < Low[lastTrough])OPBUY(); 
   } 
   if(IsPeak(shift) == true)
   {
    int currentPeak = shift;
    int lastPeak = GetLastPeak(shift);
    if(OpenSELL  && OrderSell<3  && rsi[currentPeak] < rsi[lastPeak] && High[currentPeak] > High[lastPeak])OPSELL(); 
   }
//--- close position by signal
   if(CloseBySignal)
     {
      if(OrderSell>0  && rsim30>70 && rsim60>70) CloseSell();
      if(OrderBuy>0 && rsim30<30  && rsim60<30)  CloseBuy();
     }
//---
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OPBUY()
  {
   double StopLossLevel;
   double TakeProfitLevel;
   if(StopLoss>0) StopLossLevel=Bid-StopLoss*Point; else StopLossLevel=0.0;
   if(TakeProfit>0) TakeProfitLevel=Ask+TakeProfit*Point; else TakeProfitLevel=0.0;

   ticket=OrderSend(Symbol(),OP_BUY,LOT(),Ask,Slippage,StopLossLevel,TakeProfitLevel,Koment,MagicNumber,0,DodgerBlue);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OPSELL()
  {
   double StopLossLevel;
   double TakeProfitLevel;
   if(StopLoss>0) StopLossLevel=Ask+StopLoss*Point; else StopLossLevel=0.0;
   if(TakeProfit>0) TakeProfitLevel=Bid-TakeProfit*Point; else TakeProfitLevel=0.0;
//---
   ticket=OrderSend(Symbol(),OP_SELL,LOT(),Bid,Slippage,StopLossLevel,TakeProfitLevel,Koment,MagicNumber,0,DeepPink);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void CloseSell()
  {
   int  total=OrdersTotal();
   for(int y=OrdersTotal()-1; y>=0; y--)
     {
      if(OrderSelect(y,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber)
           {
            ticket=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),5,Black);
           }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void CloseBuy()
  {
   int  total=OrdersTotal();
   for(int y=OrdersTotal()-1; y>=0; y--)
     {
      if(OrderSelect(y,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && OrderMagicNumber()==MagicNumber)
           {
            ticket=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),5,Black);
           }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double LOT()
  {
   double lotsi;
   double ilot_max =MarketInfo(Symbol(),MODE_MAXLOT);
   double ilot_min =MarketInfo(Symbol(),MODE_MINLOT);
   double tick=MarketInfo(Symbol(),MODE_TICKVALUE);
//---
   double  myAccount=AccountBalance();
//---
   if(ilot_min==0.01) LotDigits=2;
   if(ilot_min==0.1) LotDigits=1;
   if(ilot_min==1) LotDigits=0;
//---
   if(AutoLot)
     {
      lotsi=NormalizeDouble((myAccount*Risk)/10000,LotDigits);
        } else { lotsi=ManualLots;
     }
//---
   if(lotsi>=ilot_max) { lotsi=ilot_max; }
//---
   return(lotsi);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void CalculateRSI(int x1)
{
    rsi[x1] = iRSI(Symbol(),PERIOD_CURRENT,RSIperiod,RSI_applied_price,x1);             
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsPeak(int shift)
{
    
    if(iHigh(NULL,0,shift)>=iHigh(NULL,0,shift+1) && iHigh(NULL,0,shift+1)>=iHigh(NULL,0,shift+2) && iHigh(NULL,0,shift+2)>=iHigh(NULL,0,shift+3)
       && iHigh(NULL,0,shift)>=iHigh(NULL,0,shift-1) && iHigh(NULL,0,shift-1)>=iHigh(NULL,0,shift-2) && iHigh(NULL,0,shift-2)>=iHigh(NULL,0,shift-3))
        return(true);
    else 
        return(false);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsTrough(int shift)
{
    if(iLow(NULL,0,shift)<=iLow(NULL,0,shift+1) && iLow(NULL,0,shift+1)<=iLow(NULL,0,shift+2) && iLow(NULL,0,shift+2)<=iLow(NULL,0,shift+3)
       && iLow(NULL,0,shift)<=iLow(NULL,0,shift-1) && iLow(NULL,0,shift-1)<=iLow(NULL,0,shift-2) && iLow(NULL,0,shift-2)<=iLow(NULL,0,shift-3))
        return(true);
    else 
        return(false);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int GetLastPeak(int shift)
{
    for(int j = shift + 5; j < Bars; j++)
    {
        if(iHigh(NULL,0,j)>=iHigh(NULL,0,j+1) && iHigh(NULL,0,j+1)>=iHigh(NULL,0,j+2) && iHigh(NULL,0,j+2)>=iHigh(NULL,0,j+3) &&
           iHigh(NULL,0,j)>=iHigh(NULL,0,j-1) && iHigh(NULL,0,j-1)>=iHigh(NULL,0,j-2) && iHigh(NULL,0,j-2)>=iHigh(NULL,0,j-3))
            return(j);
    }
    return(-1);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int GetLastTrough(int shift)
{
    for(int j = shift + 5; j < Bars; j++)
    {
        if(iLow(NULL,0,j)<=iLow(NULL,0,j+1) && iLow(NULL,0,j+1)<=iLow(NULL,0,j+2) && iLow(NULL,0,j+2)<=iLow(NULL,0,j+3) &&
           iLow(NULL,0,j)<=iLow(NULL,0,j-1) && iLow(NULL,0,j-1)<=iLow(NULL,0,j-2) && iLow(NULL,0,j-2)<=iLow(NULL,0,j-3))
            return(j);
    }
    return(-1);
}

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+


ファイル:

応答済み

1
開発者 1
評価
(365)
プロジェクト
412
36%
仲裁
35
26% / 57%
期限切れ
63
15%
2
開発者 2
評価
(467)
プロジェクト
701
56%
仲裁
44
30% / 32%
期限切れ
114
16%
仕事中
3
開発者 3
評価
(119)
プロジェクト
127
41%
仲裁
3
33% / 67%
期限切れ
0
4
開発者 4
評価
(4)
プロジェクト
12
0%
仲裁
0
期限切れ
3
25%
5
開発者 5
評価
(49)
プロジェクト
134
27%
仲裁
62
13% / 53%
期限切れ
58
43%
6
開発者 6
評価
(117)
プロジェクト
138
41%
仲裁
30
7% / 77%
期限切れ
17
12%
7
開発者 7
評価
(17)
プロジェクト
24
33%
仲裁
5
20% / 40%
期限切れ
8
33%
類似した注文
I want to decompile an ea file and get the source code, i need it really quick as fast as possible. the file must be delivered alongside the source code
I have an algo that is running on ProRealTime, they have their own language. It is a simple strategy with 5 conditions + SL/TP settings, very basic. I need someone that can convert or just create a functional MT5 algo (EA) from these conditions for me, if you do a good job I have around 10+ more algos that need to be transferred to MT5
Dear Developers, I would have a very simple request. I have a ML model developed in Python for EURUSD daily trading. I would like to backtest it in Meta Trader 5 using the Strategy Tester tool. For that I would need an Expert Advisor program. The input would be a csv file that contains two columns: - dates (going back for a few years on a daily basis) - trading signal (it can have only 2 values, either 1: Buy, or -1
Hi I have the code in pinescript for an indicator that I need done in Ninja Trader 1. The Trading View indicator code needs to be converted into and adapted for Ninja Trader 8 2. An indicator and Automated Trading Strategy needs to be developed. 3. Any parts of the Trading View Indicator that can't be replicated needs to be discussed with me and agreed before excluding. (there should not be any) 4. Trailing stop and
1. The Trading View indicator code needs to be converted into and adapted for Ninja Trader 8 2. An indicator and Automated Trading Strategy needs to be developed. 3. Any parts of the Trading View Indicator that can't be replicated needs to be discussed with me and agreed before excluding. (there should not be any) 4. Trailing stop and Trailing Draw Down options need to be implemented 5. Risk needs to be in % of
Create mt4 ea 50+ USD
To convert the provided MT4 indicator script into an Expert Advisor (EA) and implement prompt functionality for user input, we need to modify the code to handle external parameters and provide a user-friendly interface. Below is the EA code that incorporates prompts for user inputs
I WRITE a code i want to conect this for automatic trading through vps .and als advanced features for this code .i attached afile please watch .and give me perfect ea
Hi Developer, I would like to create the Scalping EA based for Mt4 on the investing.com data https://www.investing.com/currencies/eur-usd-technical EA have timing to adjust time to trade. follow the broker time. From starting time to end time EA have a adjustable Lot size (0.01 incremental to 0.01) EA have a adjustable TP (1pip to 100pip incremental 1pip) EA have a adjustable SL (1pip to 100pip incremental 1pip) EA
This is not an EA that actually opens/closes trades. Instead this project involves creating a dashboard where the user can create a grid trade scenario with initial entry and scale trade pip distances, lot sizes for each trade, and draw down amount. It then calculates the break-even + profit level where all trades would close. For each new scale trade the BE+ point is recalculated which is then displayed on the
Hi I have the code in pinescript for an indicator that I need done in Ninja Trader, I wanted this indicator in NT bcs I chart in NT, and if the indicator could also have been an automated strategy even better. Please confirm that it will be an indicator and Automated Trading Strategy

プロジェクト情報

予算
35+ USD
開発者用
31.5 USD
締め切り
最高 3 日