jaybiz: . I'm on MT4 Version 4.0.0.1280
Current version is 1345; upgrade and recompile.
1280 seems to be the only one offered for macOS. There's supposed to be a later one, but I can't find it and created another post about that.
I just had my friend run this EA on Windows (1340) and he had the same problem I'm having.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
[Solved: turns out I had created an enum called "OrderType" in another file which was shadowing and wreaking havoc. ]
Hi all,
I'm stuck. For some reason my OP_BUYs are working, but when I try to open a OP_SELL, OrderType() always reports 0.
I'd be super-grateful if someone can help me with this. Relevent code and journal results blow. I'm on MT4 Version 4.0.0.1280 (4.0.0.1280) on a Macintosh. Lemme know if you need more info. First post ..
(Possible hint? When I try to PrintFormat("%i", OrderType()) the compiler says void type expression is illegal)
if(ShortEntrySignal && (sqGetMarketPositionCount("Current", MagicNumber, 0, "") == 0)) { double orderPrice = MarketInfo(Symbol(), MODE_BID); double slPrice = calcStopLossPrice(OrderType::SELL, orderPrice, SL_pct); double tpPrice = calcTakeProfitPrice(OrderType::SELL, orderPrice, TP_pct); double orderSize = calculateOrderSize(Symbol(), AccountBalance(), percent_acct_risk, orderPrice, slPrice); PrintFormat("INPUTS to ORDERSEND: Price: %f, orderSize: %f", orderPrice, orderSize); _ticket = OrderSend(Symbol(), OP_SELL, orderSize, orderPrice, 0, 0, 0); if(_ticket > 0 && OrderSelect(_ticket, SELECT_BY_TICKET)) { int orderType = OrderType(); PrintFormat("ORDER TYPE of ticket %i: %i", _ticket, orderType); sqSetSLandPT(_ticket, slPrice, tpPrice); } } }