Please i need help to code a correct adaptive profit in mql4
actualy i'v done this script:
extern double ProfitTarget=5;
void OnTick()
{
if (ProfitTicks == true) {
// Vérification du profit
if (AccountProfit() > ProfitTarget) {
CloseOrders();
Print(" Profit Target TICKS is OK, Close All Orders ");
Start = false;
Sleep(300000);
Start = true;
}
}
}
so when AccountProfit() is upper than ProfitTaget all the orders are closed by the CloseOrders() action
I want to adaptive the ProfitTarget
if AccountProfit() > ProfitTarget : ProfitTarget is now = ProfitTarget + 1
if (AccountProfit() > initial ProfitTarget && AccountProfit()<= lastProfitTarget ) { CloseOrders();}
to win all the Positive move of the profit and secure it to the last adaptative.
so please if someone can help me to code that in mql4 i'll be very glad.
actualy i'v done this script:
extern double ProfitTarget=5;
void OnTick()
{
if (ProfitTicks == true) {
// Vérification du profit
if (AccountProfit() > ProfitTarget) {
CloseOrders();
Print(" Profit Target TICKS is OK, Close All Orders ");
Start = false;
Sleep(300000);
Start = true;
}
}
}
so when AccountProfit() is upper than ProfitTaget all the orders are closed by the CloseOrders() action
I want to adaptive the ProfitTarget
if AccountProfit() > ProfitTarget : ProfitTarget is now = ProfitTarget + 1
if (AccountProfit() > initial ProfitTarget && AccountProfit()<= lastProfitTarget ) { CloseOrders();}
to win all the Positive move of the profit and secure it to the last adaptative.
so please if someone can help me to code that in mql4 i'll be very glad.