Moving Average Experts! - page 2

 
lomme:
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!

Files:
screen.jpg  131 kb
 
codersguru:
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!

Files:
 

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 bool ProtectProfit= true;

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!

lomme:
...in the future, waiting.

We can write Loss Protector too!

 
mj10:
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

Don't cry for that , because that's simply what the trading is!

Take profit and stop loss as soon as you can!

 
codersguru:
This is my profit protector code:
extern bool ProtectProfit= true;

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