expert adviser working on several chart at the same time - page 2

 
3056527: I don't want the computer on or on sleepstand all the time.
Must be active for the EA to do anything. Get a VPS and run it there.
 

Thanks WHRoeder for your suggestion.

But i would like to know how to set the buylevel when starting up.

I have the following code but this will give the orderprice of the first(highest) order When i have several orders).

But i need to get the last (lowest) orderprice.

void startlevel ()
{
int      lastTicket = -1;
for(int i = OrdersTotal()-1;i >= 0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))                                 
if(OrderMagicNumber()==magicnumber)                                           
if (OrderSymbol()==Symbol())                                                 
if(OrderType()==OP_BUY)   
                                                   
buylevel = (OrderOpenPrice());
Alert(buylevel);

Need some help whit this.

 

Solved my prblem with buylevel.

Check code.

void startlevel ()
{

for(int i = 1;i<=OrdersTotal();i++)
{
if(OrderSelect(i-1,SELECT_BY_POS,MODE_TRADES)==true)                                 
if(OrderMagicNumber()==magicnumber)                                           
if (OrderSymbol()==Symbol())                                                 
if(OrderType()==OP_BUY)   
                                                   
buylevel = (OrderOpenPrice());
Alert(buylevel);
Reason: