MT5 Stoploss /Take profit and order placing code written for existing EA that produces buy and sell signals

Работа завершена

Время выполнения 1 день
Отзыв от исполнителя
The best. Good customer. Strongly recommended.
Отзыв от заказчика
Great service, quick and efficient, great communication and could recommend anyone that needs coding work done to reach out. Thanks

Техническое задание

Hi,


I have coded up a EA that produces buy and sell signals in the EA Journal. I need someone's services that can add the final touches to make it a functioning robot.


Required:

* Trade placed at the the close price of the candle that produces the signal.

* Stop loss placed at the lowest price (for a buy) and the highest price (for a sell) between the stochastic cross that produced the signal and the previous stochastic   cross.

* Take profit is a user defined multiplier of the stop loss price (default 1.5X).

* Only one trade open on the same symbol at any time.

* Base account currency of AUD.

* User defined account capital.

* User defined percentage/dollar risk of capital per trade (maximum loss amount for a loosing trade).

* Alerts to phone and app when a buy/sell signal is received.

*Place trade and close trade using the take profit and stop loss with my broker.


Current EA code is below.


//SuperTrend Stochastic Strategy
#property copyright "DCowie"


//User input Variables
input ENUM_TIMEFRAMES Timeframe = PERIOD_CURRENT;

input int SuperTrend_ATR_Legnth = 10;
input int SuperTrend_Factor = 3;
input int Stochastic_K_Legnth = 8;
input int Stochastic_K_Smoothing = 3;
input int Stochastic_D_Legnth = 3;
input int EMA_Legnth = 200;


//EA Handles
int ATR_SuperTrend_Handle;
int Stochastic_Handle;
int EMA_Handle;
int TotalBars;

int OnInit(){

//Definition to only trade once per bar
   TotalBars = iBars(_Symbol, Timeframe);

//Indicator Handle definitions
   ATR_SuperTrend_Handle = iCustom(_Symbol, Timeframe, "ATR SuperTrend", SuperTrend_ATR_Legnth, SuperTrend_Factor);
   Stochastic_Handle = iStochastic(_Symbol, Timeframe, Stochastic_K_Legnth, Stochastic_D_Legnth, Stochastic_K_Smoothing,MODE_SMA,STO_LOWHIGH);
   EMA_Handle = iMA(_Symbol, Timeframe, EMA_Legnth, 0, MODE_EMA, PRICE_CLOSE);
  
   return(INIT_SUCCEEDED); 
}

void OnDeinit(const int reason){
   
}

void OnTick(){

//Get number of Bars
   int bars = iBars(_Symbol, Timeframe);
   if(TotalBars != bars) {
      TotalBars = bars;
      
//Data Collection Arrays      
   double ATR_SuperTrend_Array [];
   double K_Array [];
   double D_Array [];
   double EMA_Array[];
   double Candle_Close_Price_Array[];
   
//Sort the array from the current candle backwards
   ArraySetAsSeries(K_Array, true);
   ArraySetAsSeries(D_Array, true);
   ArraySetAsSeries(EMA_Array, true);
   ArraySetAsSeries(Candle_Close_Price_Array, true);   

//Fill the array with data  
   CopyBuffer(ATR_SuperTrend_Handle, 0, 0, 3, ATR_SuperTrend_Array);
   CopyBuffer(Stochastic_Handle, 0, 0, 3, K_Array);
   CopyBuffer(Stochastic_Handle, 1, 0, 3, D_Array);
   CopyBuffer(EMA_Handle, 0, 0, 3, EMA_Array);
   
//Get Close Price of Current candle
   CopyClose(_Symbol, Timeframe, 0, 3, Candle_Close_Price_Array);
   
//Calculate the candle close for the current and previous candles (SuperTrend)
   double close1 = iClose(_Symbol, Timeframe, 1);
   double close2 = iClose(_Symbol, Timeframe, 2);


//Calculate the Stochastic value for the current candle
   double K_Value0 = K_Array[0];
   double D_Value0 = D_Array[0];

//Calculate the Stochastic value for the last candle
   double K_Value1 = K_Array[1];
   double D_Value1 = D_Array[1];

   double K_Value2 = K_Array[2];
   double D_Value2 = D_Array[2];
   
//Calculate the EMA Value for the current and previous candle
   double EMA_Value0 = EMA_Array[0];
   double EMA_Value1 = EMA_Array[1];

//Calculate the candle close for the current and previous candle
   double CandleClosePrice0 = Candle_Close_Price_Array [0];
   double CandleClosePrice1 = Candle_Close_Price_Array [1];
   double CandleClosePrice2 = Candle_Close_Price_Array [2]; 

   bool Condition1 = close1 > ATR_SuperTrend_Array [1] && close2 > ATR_SuperTrend_Array [0],
        Condition2 = K_Value2 > D_Value2 && K_Value1 < D_Value1,
        Condition3 = D_Value2 > K_Value2 && D_Value1 < K_Value1,
        Condition4 = CandleClosePrice1 > EMA_Value1,
        Condition5 = close1 < ATR_SuperTrend_Array [1] && close2 < ATR_SuperTrend_Array [0],
        Condition6 = CandleClosePrice1 < EMA_Value1;

//Buy Condition 
// If stochastic crosses in either direction and the SuperTrend is GREEN and the candle close is ABOVE the EMA Buy      
   if (Condition1 && Condition4) {        
   
   if (Condition2 || Condition3){ 
    
      Print(__FUNCTION__, " >Buy Signal...");
      
} 

}

//Sell condition
//If stochastic crosses in either direction and the SuperTrend is RED and the candle close is BELOW the EMA Sell
    else if(Condition5 && Condition6) {
   
         if (Condition2 || Condition3){


      Print(__FUNCTION__, " >Sell Signal...");

}
}
}
}


Thanks for your time and I look forward to hearing from you.


Cheers,


Dale

Откликнулись

1
Разработчик 1
Оценка
(34)
Проекты
60
23%
Арбитраж
11
73% / 9%
Просрочено
3
5%
Свободен
2
Разработчик 2
Оценка
(363)
Проекты
389
70%
Арбитраж
3
100% / 0%
Просрочено
2
1%
Работает
3
Разработчик 3
Оценка
(42)
Проекты
47
30%
Арбитраж
12
17% / 75%
Просрочено
6
13%
Свободен
4
Разработчик 4
Оценка
(2)
Проекты
1
0%
Арбитраж
3
0% / 33%
Просрочено
0
Свободен
5
Разработчик 5
Оценка
(52)
Проекты
97
24%
Арбитраж
10
20% / 20%
Просрочено
12
12%
Работает
Похожие заказы
preciso de um robô com duas médias móveis, uma exponencial high e uma exponencial low. preciso também ter a opção de utilizar e todos os tempos gráficos e alterar os parâmetros das médias. entrada de compra será feita quando um candle de alta romper e fechar a cima da média high e fechará a posição quando um candle de baixa romper e fechar a baixo da média low. a venda será feita quando o candle de baixa romper e
Description - An expert advisor(s), placing sell trades in EUR/USD, based on the close price of the previous two candles, as shown in the figure below. The trades would be made in the 5 minute, 1 hour, and 1 day timeframes. In the 5 minute and 1 hour timeframes the market orders would be placed at the start of a new candle, at specific times EST. The order would be cancelled at the close of that candle, i.e after 5
Greetings, As the title suggests, I am trying to convert an indicator that calls itself via an iCustom call like this. iMAArray_Buffer[loop_1] = iCustom ( NULL , Selected_TF, MQLInfoString ( MQL_PROGRAM_NAME ), "calculate" , RPeriod, MType, MPeriod, 1 , shift); Full code will not be provided, only the position that needs fixing. I cannot get this working in MQL5 but the original code runs smoothly in MQL4. Please
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
Greetings great developer, I am in search of a highly skilled developer to assist with an exciting project. I need to convert two open-source TradingView indicators to NinjaTrader 8 and implement a usage restriction based on computer IDs. If you have experience with NinjaTrader 8 coding please let me know. I’d be happy to discuss the details further
Greetings great developer, I am in search of a highly skilled MQL5 developer to assist with an exciting project. I need to convert two open-source TradingView indicators to NinjaTrader 8 and implement a usage restriction based on computer IDs. If you have experience with NinjaTrader 8 coding please let me know. I’d be happy to discuss the details further
Hi, I need a robot, which wil get instructions to trade in 3 symbols at the same time based on few parameters and calculations. Example: There is 1 symbol called Gold-Near and the rate for it is 1000-1002 If i specify that when the rate reaches 1050, it should sell 1 lot Upon execution it will have to sell 1 lot of cme gold, buy 3 lots of mcx gold and buy currently (lots will be based on calculation). All the
Trading bot 300+ USD
We need bot that trades when medium and low impact news hits It will release pending order both directions few min prior to news impact And will have certain risk management strategy attached Example If Monday and Tuesday news successful clears profits It will reduce risk for next news events until new week starts each week message on tg: Dstatewealthtrading NOTE: 4 YAERS OF EXPERIENCE UPWORD, YOU MUST BE A
I need someone the create a supertrend indicator based on Heikin Ashi candles instead of normal candles. Needs to be exactly the same as the supertrend (original one) + ha from tradingview. In m1,m5,m15 the indicator must have the same values ​​found with the tradingview. Work that meets this requirement will be accepted ( depending on the broker and spread, however, a few pips of difference will be accepted)

Информация о проекте

Бюджет
30+ USD
Исполнителю
27 USD
Сроки выполнения
до 5 дн.