Spezifikation
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 bool
useBasketprofitpct_Low_high=true; //new
function
extern double basketprofitpct_Low_high=2; //new
function
If „xtern bool useBasketprofitpct_Low_high=true;“
„extern double basketprofitpct_Low_high=2; „
à count profit closed
buy-position (like „extern bool
useBasketprofitpct=true;“ but only the buy-posistions)
à count profit of the
lowest open sell-position
à if (profit closed buy
positions (similar like „useBasketprofitpct“) + 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 of the
highest open buy-position
à if (profit closed sell
positions (similar like „useBasketprofitpct“) + 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 fort he buy and the sell-posistions and adding the lowestsellposion and hightestbuyposistion!