Hi
Why is this not working if I may ask:
The EA works when I have only the profit side of things but when I add the loss side as well it opens and closes the orders immediately after opening the pending orders that it places.I just want the EA to close all order when a certain profit or loss level is reached.....
(Please bear in mind I only started coding about a month ago.Also how do I add code in that funny window here at FF and not in the main post.)
In the Global area I declare :
"
double initaite_equity=0;
"
In the "init" I declare :
"
initaite_equity=AccountEquity();
"
Then in the OnTick:
if(Enable_Total_Profit==true)
{
if(AccountEquity()-initaite_equity>=Total_Profit)
{
Print("The Desired_Profit reached as total profit is at : "+Total_Profit);
CloseAll();
}
if(Enable_Total_Profit==true)
{
if (initaite_equity)-(AccountEquity()>=Total_Loss);
Print("Max Loss reaced at : "+Total_Loss);
CloseAll();
}
}
Thank you for your time
Rooi
Why is this not working if I may ask:
The EA works when I have only the profit side of things but when I add the loss side as well it opens and closes the orders immediately after opening the pending orders that it places.I just want the EA to close all order when a certain profit or loss level is reached.....
(Please bear in mind I only started coding about a month ago.Also how do I add code in that funny window here at FF and not in the main post.)
In the Global area I declare :
"
double initaite_equity=0;
"
In the "init" I declare :
"
initaite_equity=AccountEquity();
"
Then in the OnTick:
if(Enable_Total_Profit==true)
{
if(AccountEquity()-initaite_equity>=Total_Profit)
{
Print("The Desired_Profit reached as total profit is at : "+Total_Profit);
CloseAll();
}
if(Enable_Total_Profit==true)
{
if (initaite_equity)-(AccountEquity()>=Total_Loss);
Print("Max Loss reaced at : "+Total_Loss);
CloseAll();
}
}
Thank you for your time
Rooi
We miss 100% of the shots we don't take