I need help Please!

 

Hello Everyone

I am having a problem with my ordersend() function, and I hope someone will help me.

I have developed my own expert advisor with my own strategy. What actually happened, during the fast price movement my expert advisor does not place an order, but in case of slow movement it works very well and place an order. For example, I want to place a buy order 20 pips away from the current price which is 1.2300 including spread, and order must be placed at 1.2300. After that, the price moved little bit fast because of news release, and in fraction of seconds the price went 60 pips away, which was 1.2240 and order, should have placed at 1.2300, but it did not. I was sitting in front of the computer, and was watching the price movement very carefully. I knew that when the price will come to 1.2300 the order will place but for whatever the reason, the order was not placed and the price value went little bit far away. As a matter of fact, I saw when the price went back to 1.2300 after a while, which I knew; at that time it placed an order. I have no idea how to fix this problem.

You cooperation is highly appreciated.

SoberCanadian

 

Hi

it would be easier if you post the code for placing orders.

and error logs.


if all the logic is correct, the only reasons i have is


1. EA is to complex and does calculations for a few seconds before the fast movement and is missing ticks.


2. Stop or limit orders is to close to marketprice

When calculating correct prices, it is also necessary to consider the limitations of the service provider (dealing center). 
These limitations include the minimum distance and the freeze distance. 
These limitations mean that the broker needs some time for preparations for performing of new trades, 
whether converting a pending order into a market one or closing an order by stop order. 


Hope this gives you some ideas atleast

//Enotrek

 

SC

> for whatever the reason, the order was not placed

What did the Experts and Journal tabs show at this time?

-BB-

 
After that, the price moved little bit fast because of news release, and in fraction of seconds the price went 60 pips away, which was 1.2240 and order, should have placed at 1.2300, but it did not.

When the bid hit your open price, the limit order became a market order, but because prices moved so fast the market moved beyond your allowed slippage and the order didn't fill.

Perhaps you are running on a 5 digit broker and haven't adjusted the slippage value for 5 digits?

//++++ These are adjusted for 5 digit brokers.
double  pips2points,    // slippage  3 pips    3=points    30=points
        pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int init(){
    if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
    // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl