| / | Forum |
|
DennisJorgenson
2011.08.08 14:59
I'm now back to programming MT4 - after all the changes the NFA/CFTC put in our way, and now a very odd thing is happening with build 402 -- every so often (enough that this needs to be addressed) I get 129 errors (Invalid Price) - here's a print showing the price used and the current bid/ask: 02:42:59 IQIv1-Production EURUSD,M5: Order close failure; ticket (2094674633): Invalid Price(129): 1.42826000 Bid:1.42826000 Ask:1.42847000 As you can see, the price used (immediately to the right of the (129)) and the Bid are identical. This was a long trade I was trying to close out, so Bid should have been adequate. I also use spread*4 for slippage - so, that's not the issue. I never got this error before - and, haven't found any recent articles about anyone who has experienced this same behavior ... hints? |
|
Indicator Alternative Ichimoku – Setup, Examples of Usage How to set up Alternative Ichimoku correctly? Read the description of parameters setting up. The article will help you understand the methods of setting up parameters not only of the indicator Ichimoku. Certainly you will also better understand how to set up the standard Ichimoku Kinko Hyo. |
|
RaptorUK
2011.08.08 15:11
Maybe you needed to do a RefreshRates before trying to close the order ?
|
|
DennisJorgenson
2011.08.08 15:27
RaptorUK:
Maybe you needed to do a RefreshRates before trying to close the order ?
I chose to use a variable because when I was coding for a newer broker, the Ask and Bid on opens and closes seemed to count substantially - by using the variable (set either to Bid or Ask depending on the operation) I stopped a lot of requotes (#138s) that I seem to start getting a lot of lately also. |
|
RaptorUK
2011.08.08 15:42
Sorry, just to be clear . . . . if you store values for your bid and ask variables then your code does something for a couple of seconds the bid and ask may change . . then you try to close your order and you have invalid values stored in your variables . . . it's impossible to say if your code is doing this without seeing the code. You can test it by adding a RefreshRates(); and Print("Bid = ",Bid," Ask = ", Ask); just before you try to close the order, if your Bid and Ask variables are out of date you will see the difference . . |
|
DennisJorgenson
2011.08.09 02:07
RaptorUK:
Sorry, just to be clear . . . . if you store values for your bid and ask variables then your code does something for a couple of seconds the bid and ask may change . . then you try to close your order and you have invalid values stored in your variables . . . it's impossible to say if your code is doing this without seeing the code. You can test it by adding a RefreshRates(); and Print("Bid = ",Bid," Ask = ", Ask); just before you try to close the order, if your Bid and Ask variables are out of date you will see the difference . .
My code looks like this: //+------------------------------------------------------------------+ ticket=OrderSend(Symbol(), if (ticket<1) Any hints? |
|
RaptorUK
2011.08.09 02:38
DennisJorgenson:
My code looks like this: Any hints? I thought you were having problems closing an order ? why are you showing the code to open an order ? If you enter start() on a tick, store values of Bid and Ask, sleep 10 seconds then print these variables and also print Bid and Ask you will get the same values for the stored values and the Bid and Ask . . . from what I understand you need a new tick or you use RefreshRates to update Bid and Ask. I'm not talking about Normailizing . . I'm talking about getting fresh values for Bid and Ask . . . |
|
DennisJorgenson
2011.08.09 02:51
RaptorUK:
I thought you were having problems closing an order ? why are you showing the code to open an order ? If you enter start() on a tick, store values of Bid and Ask, sleep 10 seconds then print these variables and also print Bid and Ask you will get the same values for the stored values and the Bid and Ask . . . from what I understand you need a new tick or you use RefreshRates to update Bid and Ask. I'm not talking about Normailizing . . I'm talking about getting fresh values for Bid and Ask . . .
//+------------------------------------------------------------------+ switch (error) Print(errmsg); |
|
RaptorUK
2011.08.09 03:03
If you get this error consistently you should try this . . . RefreshRates(); // <----------------------- add this if (OrderType()==OP_BUY) price = Bid; if (OrderType()==OP_SELL) price = Ask; |
|
WHRoeder
2011.08.09 20:03
|