| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all, i have this error and i don't understand how to figure out, i think it's a problem of matching different types of variables
here is the snippet of the code double BuyCondition, SellCondition, StopLong, StopSell; the indicators are double indicator1, indicator2 indicator 3; (but is int) so i want those conditions PHP Code:
p.s. sellvalue and buyvalue are double |
|
|||
|
OrderClose error
Something goes wrong. The demo account was wiped out completely.
Here is a small part from the expert log, with hundreds of those "invalid price for OrderClose function" : GBPJPY at 209.23 sl: 212.23 tp: 208.23 ok 10:00:04 2730_BasketVentilatorVoorProg_2 GBPCHF,H1: invalid price 2.02750000 for OrderClose function 10:00:04 2730_BasketVentilatorVoorProg_2 EURUSD,H1: invalid price 1.55750000 for OrderClose function 10:00:04 2730_BasketVentilatorVoorProg_2 GBPCHF,H1: close #11685361 sell 0.10 GBPCHF at 2.0270 sl: 2.0570 tp: 2.0170 at price 2.0275 10:00:05 2730_BasketVentilatorVoorProg_2 USDCHF,H1: invalid price 1.03350000 for OrderClose function 10:00:05 2730_BasketVentilatorVoorProg_2 EURUSD,H1: invalid price 1.55740000 for OrderClose function this is the part in the ea for the OrderClose, I do not see what is wrong in it, maybe someone can help? //--------------------- int l_ord_total_72 = OrdersTotal(); for (int l_pos_76 = 0; l_pos_76 < l_ord_total_72; l_pos_76++) { if (OrderSelect(l_pos_76, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol()) { l_cmd_80 = OrderType(); if (l_cmd_80 == OP_BUY) { l_count_56++; if (l_isar_48 > Close[0]) OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet); } if (l_cmd_80 == OP_SELL) { l_count_60++; if (l_isar_48 < Close[0]) OrderClose(OrderTicket(), OrderLots(), Ask, 3, Violet); } } } } //-------------------- Compiling does not give an error. Last edited by panteraschoice; 06-10-2008 at 01:10 PM. |
|
||||
|
Quote:
__________________
You need proffesional mql coder? Contact me! I will help you! ........................................ http://www.fxservice.eu/ ........................................ |
|
|||
|
no i don't want to publish all but i think is a problem with the types match of variables i'll try to explain more
indicator1 e 2 are double right so i have buyvaluecurrent = icustom(indicator1 etc etc); buyvaluecurrent2 = icustom(indicator2 etc etc); sellvaluecurrent = icustom(indicator1 etc etc); //doubles right? trenendvup =icustom (indicator3 etc etc) ; //int and so on so buycondition= ((buyvaluecurrent !=0 && buyvaluecurrent2 !=0) && (trendenvup != Empty_Value); this statment works only sometimes and also could be a problem, so my question is why? i want that buycondition returns 1 or 0 no matter of what type is bool or double |
|
||||
|
depending on what the iCustom indicators are sending out...
double buyvaluecurrent = iCustom(indicator1); double buyvaluecurrent2 = iCustom(indicator2); double sellvaluecurrent = iCustom(indicator1); int trenendvup = iCustom(indicator3); so... if((buyvaluecurrent !=0 && buyvaluecurrent2 !=0) && (trendenvup !=0)) {buycondition=0;} if((buyvaluecurrent !=0 && buyvaluecurrent2 !=0) && (trendenvup !=1)) {buycondition=1;} you can't get a bool into your buycondition only by using "&&" and some conditions, use if() function... hope this helps, otherwise it's a little step closer ![]() Quote:
|
|
|||
|
ok ok ok!
here is more! PHP Code:
the icustom funcions and buy sell PHP Code:
PHP Code:
Last edited by payback; 06-10-2008 at 06:03 PM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |