OrderOpenPrice() does not work correctly - page 2

 
xwdx:

I decided to upload my EA to the Code Base. If you are interested in what I am trying to do, feel free to read the description posted there.

Of course it will take its time to get the post published, but I will post a link here when its published.

But the lines I programmed here are disabled in the uploaded version so far.


Edit: It isn't as long as I don't need it, but I will change that in the future.


Bad decission hope it is not gonna published this way....

 
xwdx:

I decided to upload my EA to the Code Base. If you are interested in what I am trying to do, feel free to read the description posted there.

Wow  . . .   why do you close all trades if you change timeframe or parameters ?  including trades that don't belong to this EA . . .  

int deinit ()
{
   while (OrdersTotal()>0) {
      OrderSelect(0,SELECT_BY_POS);
      if (OrderType() == OP_BUY) OrderClose(OrderTicket(),Lots,Bid,1,CLR_NONE);
      if (OrderType() == OP_SELL)OrderClose(OrderTicket(),Lots,Ask,1,CLR_NONE);
      if (OrderType() != OP_BUY && OrderType() != OP_SELL) OrderDelete(OrderTicket(),CLR_NONE);
   }        
 
return(0);
}

 

Why aren't you checking the return values from your Trading Functions and reporting errors ?   What are Function return values ? How do I use them ?

 

As written in the description of the EA and this post, it isn't possible to have any other trades except the EA-trades open. Since this is an order-placement-tool, I decided that I wanted some kind of emergency brake if I decide to close everything. And like the word "tool" implies: You only use it, when you need it. It won't be useful in every single situation.

The problem with changing timeframes can easily be handeled with an additional chart-window.

Nevertheless, this is a tool optimised for my needs. I uploaded it because there might be someone who can use this (modified or in its original form).

Reason: