New function profit counting and closing

MQL4 Experts Integração

Termos de Referência


I would like to have a new function in my EA.

later i will upload the EA for Integration in the EA


New Funktion:

 

extern …….   useBasketprofitpct_Low_high=true;          //new function

extern …….. basketprofitpct_Low_high=2;                         //new function

 

If „extern bool   useBasketprofitpct_Low_high=true;“
„extern ……. basketprofitpct_Low_high=2; „

>>count-profit-closed-buy-position (like „extern bool   useBasketprofitpct=true;“ but only the buy-posistions)
>>count-profit-open-buy-posistions
>>count-profit-of-the-lowest-open-sell-position
>>if (profit-closed-buy-positions (similar like „useBasketprofitpct“) + profit-open-buy-posistions + profit-of-the-lowest-open-sell-posistion >=basketprofitpct_low_high*0.01*AccountBalance()
                then close all open buy-posistions and the lowest-open-sell-position

 

>>count-profit-closed-sell-position (like „extern bool   useBasketprofitpct=true;“ but only the sell-posistions)
>>count-profit-open-sell-posistions
>>count-profit-of-the-highest-open-buy-position
>>if (profit-closed-sell-positions (similar like „useBasketprofitpct“) + profit-open-sell-posistions + profit-of-the-highest-open-buy-posistion >=basketprofitpct_low_high*0.01*AccountBalance()
                then close all open sell-posistions and the highest-open-buy-position

 

 


 

 

Function in the EA: „useBasketprofitpct“

 

   if(useBasketprofitpct)

     {

      if(basketpercentflag=="CLOSE")if(countall(1)==0)basketpercentflag="";

      if(countprofit(1)>=nd(basketprofitpct*0.01*AccountBalance(),2) || countprofit(1)<=-1*nd(basketlosspct*0.01*AccountBalance(),2)) basketpercentflag="CLOSE";

      if(basketpercentflag=="CLOSE")

        {

         close(OP_BUY);close(OP_SELL);deletes(7);deletes(8);

         timex=TimeCurrent();

        }

      //Comment("\nprofit = "+DoubleToStr(countprofit(1),2));

     }

 

>>>>>>>/// i wanna the same just only for the buy and the sell-posistions and adding the lowestsellposion and hightestbuyposistion!

 



Respondido

1
Desenvolvedor 1
Classificação
(362)
Projetos
506
40%
Arbitragem
148
18% / 72%
Expirado
99
20%
Ocupado
2
Desenvolvedor 2
Classificação
(298)
Projetos
427
26%
Arbitragem
18
61% / 33%
Expirado
26
6%
Livre
3
Desenvolvedor 3
Classificação
(53)
Projetos
79
18%
Arbitragem
13
15% / 54%
Expirado
5
6%
Livre
4
Desenvolvedor 4
Classificação
(258)
Projetos
395
28%
Arbitragem
69
19% / 49%
Expirado
120
30%
Livre
Pedidos semelhantes
I want to export the live feed from my market watch to my technical analysis software. They have provided me an api also. Is there a way that their api can be integrated and take rates from my mt5 client terminal

Informações sobre o projeto

Orçamento
20 - 30 USD
Desenvolvedor
18 - 27 USD
Prazo
de 2 para 3 dias