Requests & Ideas, the beginning - page 18

 

Can someone please help me with this small request described on the first post above. Again I am trying to figure out how to extract my average open price based on my open trades.

Thanks in advance,

TimeFreedom

 

I think you need to post your EA so that the other members can look at your code. The job should not be difficult, but it's impossible to say without seeing the code...

 

must be the way the markets are goign but 5k has been more then enough to keep it running and making profit everyday. It is still very early days but from what ive seen very impressive.

 

many thanks for the help,

 
ZTrader:
I think you need to post your EA so that the other members can look at your code. The job should not be difficult, but it's impossible to say without seeing the code...

ZTrader,

Why would you need the EA to figure out how to code average prices based on open orders?

TimeFreedom

 

AveragePrice()

Hi TimeFreedom,

Please try this function:

double AveragePrice()

{

int total = OrdersTotal();

double sum = 0;

for (int cnt = total-1 ; cnt >=0 ; cnt--)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

sum = sum + OrderOpenPrice();

}

if (sum == 0) return (0);

else return (sum/total);

}

[/PHP]

Use it like this:

[PHP]double ap = AveragePrice(); // <-- The Average Price of all opend trades
 
codersguru:
Hi TimeFreedom,

Please try this function:

double AveragePrice()

{

int total = OrdersTotal();

double sum = 0;

for (int cnt = total-1 ; cnt >=0 ; cnt--)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

sum = sum + OrderOpenPrice();

}

if (sum == 0) return (0);

else return (sum/total);

}

[/PHP]

Use it like this:

[PHP]double ap = AveragePrice(); // <-- The Average Price of all opend trades

CodersGuru,

Thanks for your quick responce. Hopefully I can give back to you somehow. Maybe we can work on a profitable system together sometime soon.

TimeFreedom

 

Price Cross

TrailingStop = 100 ?

 
xra:
TrailingStop = 100 ?

Default settings.

It means:

TrailingStop = 50;

Stop loss = 50;

Take Profit = 200

and so on ...

 

Ea Help...please!!!

This EA which I've been trying to modify to my trading style keeps opening double trades (one buy and one sell) on the same currency pair(s).

For the life of me I cannot figure out why or fix this EA to keep it from doing this. I only want one trade in one direction to be open at time.

Can anyone who is more experienced at programming please HELP me with this.

Thanks

Files:
Reason: