[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 414
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
Thank you! Found some more here, maybe someone will need it. Going to finish the grail:)
Если массив double а нужен int? Я правильно понял?
No. I'm writing the MT4 link to other applications via sockets. Socket function returns int array:
I import this dll into EA. However, to call this function, it needs to be declared in the Expert Advisor:
The above declaration is most likely not correct - a dll-option returns an array, while a function declared in an Expert Advisor will return a single int.
How to declare it in an Expert Advisor so that it returns an array, not a single number?
Who knows?
How to specify a variable double in the specified accuracy format without rounding the number, for example specify Bid=1.3988 as Bid=1.398 ???
Кто знает?
Как указать переменную double в указаном формате точности без округление числа, к примеру Bid=1.3988 указать как Bid=1.398 ???
like this?
All sorted out, the answer is here: https://forum.mql4.com/ru/25945
Please help...
\end_of_program' - unbalanced left parenthesis
extern double Lots = 0.1; extern int TrailingStop=0; extern string symbol="GBPUSD"; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { double ma_close,ma_close_pr,ma_open,ma_open_pr; double spread,sl_buy,sl_sell,high,high_n,low,low_n; int cnt, ticket, total; if(Bars<55) { Print("bars less than 55"); return(0); } // to simplify the coding and speed up access // data are put into internal variables ma_close=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,1); ma_close_pr=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,2); ma_open=iMA(NULL,0,5,0,MODE_EMA,PRICE_OPEN,1); ma_open_pr=iMA(NULL,0,5,0,MODE_EMA,PRICE_OPEN,2); spread=MarketInfo(symbol,MODE_SPREAD); sl_buy=iLow(NULL,0,1)-spread*Point; sl_sell=iHigh(NULL,0,1)+spread*Point; high=iHigh(NULL,0,1); high_n=iHigh(NULL,0,0); low=iLow(NULL,0,1); low_n=iLow(NULL,0,0); //---- total=OrdersTotal(); if(total<1) { // no opened orders identified if(AccountFreeMargin()<(1000*Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } // check for long position (BUY) possibility if(ma_close>ma_open && ma_close_pr<ma_open_pr && high_n>high) { ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,sl_buy,0,"FXJEDDI_MTF:Buy",16384,0,Lime); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); return(0); } // check for short position (SELL) possibility if(ma_close<ma_open && ma_close_pr>ma_open_pr && low_n<low) { ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,sl_sell,0,"FXJEDDI_MTF:Sell",16384,0,Red); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice()); } else Print("Error opening SELL order : ",GetLastError()); return(0); } for(int i = 0; i < OrdersTotal(); i++) { // выбор одера if(OrderSelect(i, SELECT_BY_POS) == false) continue; // not current symbol if(OrderSymbol() != Symbol()) continue; } if(OrderType() == OP_SELL) { //при профите >20 pips добавится или докупится ... if(OrderProfit()>20) OrderSend(Symbol(),OP_SELL,Lots,Bid,3,sl_sell,0,"FXJEDDI:Sell",16384,0,Red); } if(OrderType() == OP_BUY) { //при профите >20 pips добавится или докупится ... if(OrderProfit()>20) OrderSend( (Symbol(),OP_BUY,Lots,Ask,3,sl_buy,0,"FXJEDDI:Buy",16384,0,Lime); } return(0); }What's wrong?Part 2.
Necron скобку где то не закрыл, ищи...
Have you put the addendums in the correct code?