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!