it performed good for like 5 to 9 hour after that loss profit is less and loss is great by the way i would suggest to use time function and protect profit is great feature to
it performed good for like 5 to 9 hour after that loss profit is less and loss is great by the way i would suggest to use time function and protect profit is great feature to
i think profit is now over
Don't cry for that , because that's simply what the trading is!
Hi codersguru, just a small question. How do you define the MagicNumber variable on your function ? I mean is it some kind of global variable definition ? Thank you in advance
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Because 3 SL hittings in a row now and you are gone. With real money that would be like gambling in casino.
Where are the 3 SL?
Statement update!
Maybe it's a phenomena
!
100USD to 315USDin 4 hours!
Where are the 3 SL?
...in the future, waiting.
Statement update!
My profit dropped down to 144
, I'm writting a profit protector code right now!
as always
as always it happen
like u can take my example of EA
it performed good for like 5 to 9 hour after that loss profit is less and loss is great by the way i would suggest to use time function and protect profit is great feature to
i think profit is now over
profit protector!
This is my profit protector code:
extern double ProfitToProtect = 150;
int start()
{
...
if(ProtectProfit)
ProfitProtect(ProfitToProtect);
....
}
void ProfitProtect(double profit)
{
int total = OrdersTotal();
double MyCurrentProfit=0;
for (int cnt = 0 ; cnt < total ; cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber)
MyCurrentProfit += OrderProfit();
}
Print("My Current Profit is : " + DoubleToStr(MyCurrentProfit,2) + " While My Profit Target is " + DoubleToStr(profit,2));
if(MyCurrentProfit>=profit)
CloseAll();
}
void CloseAll()
{
int total = OrdersTotal();
for (int cnt = 0 ; cnt < total ; cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber)
if(OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Violet);
if(OrderType()==OP_SELL)
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet);
}
}Loss Protector!
...in the future, waiting.
We can write Loss Protector too!
as always it happen
like u can take my example of EA
it performed good for like 5 to 9 hour after that loss profit is less and loss is great by the way i would suggest to use time function and protect profit is great feature to
i think profit is now overDon't cry for that
, because that's simply what the trading is!
Take profit and stop loss as soon as you can!
This is my profit protector code:
extern double ProfitToProtect = 150;
int start()
{
...
if(ProtectProfit)
ProfitProtect(ProfitToProtect);
....
}
void ProfitProtect(double profit)
{
int total = OrdersTotal();
double MyCurrentProfit=0;
for (int cnt = 0 ; cnt < total ; cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber)
MyCurrentProfit += OrderProfit();
}
Print("My Current Profit is : " + DoubleToStr(MyCurrentProfit,2) + " While My Profit Target is " + DoubleToStr(profit,2));
if(MyCurrentProfit>=profit)
CloseAll();
}
void CloseAll()
{
int total = OrdersTotal();
for (int cnt = 0 ; cnt < total ; cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber)
if(OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Violet);
if(OrderType()==OP_SELL)
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet);
}
}I've set my profit protectot level to 150USD and I'll (ojala) get them!
150USD from 100USDin 5 hours are ??? what?
Hi codersguru, just a small question. How do you define the MagicNumber variable on your function ? I mean is it some kind of global variable definition ? Thank you in advance