Questions from Beginners MQL4 MT4 MetaTrader 4 - page 182

 
I need two mt4 terminals, one of them is always running an EA, and the second one is used for manual trading with another broker. can i have two mt4 terminals on one computer? if so, how should i install them?
 
Trader53lutsk:
I have a need for two mt4 terminals, one is always running an EA and the other is needed for manual trading through another broker. Can I ask if I can have two mt4 terminals on one computer? If so, how should I install them?

1. You can.

2. In different folders

 



Good afternoon.

Why is the order not closing on time?

Thank you



//+------------------------------------------------------------------+

//| bit.mq4 |
//| Copyright 2019, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict

extern double Lot= 0.01;
extern int Magic = 12456;
extern int STOP = 50;
extern int Slippage=10;

int ticket;
//+------------------------------------------------------------------+
//| Expert initialisation function |
//+------------------------------------------------------------------+
int OnInit()
{
//---

//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---

}
//+------------------------------------------------------------------+
//| expert tick function |
//+------------------------------------------------------------------+

void OnTick()
{
//-------------------------Open order--------------------------------------------------------------------
{
if(OrdersTotal()==0 && OpenOpenOrderTime(NeedOpen,StillOnTime)==0)
{
if(ticket=OrderSend(Symbol(),OP_BUY,Lot,Bid,STOP,0, "BITCOIN",Magic,0,Gold));
Print("Order placing error");
}
}

//----------------Closed order------------------------------------------------------------------------

if(TimeToClosed(NeedToClosed,WeHaveChoice)==1 )
{
for(int i=OrdersTotal() -1; i>=1; i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderMagicNumber()==Magic && OrderType() == OP_SELL)
OrderClose(OrderTicket(),OrderLots(),Ask,110,Black);

Print("Order no closed");
} //else Print("Order no open");
}
}

}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+


//-----------------------------------------------------------------------------------------
//--------------------------------OpenTime---------------------------------------------------------

datetime NeedOpenB=StrToTime("00:15");// Open time
datetime StillLate=60*10;//Waiting for tick max. 2 minutes
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
intOpenOrderTime(datetimeOpenTime,datetimeTimeAfter)
//open time - when to open the order
//Went time - allowed time to wait afterOpen time when the order can still be opened
// Returns -1 Time has not yet been reached
// 0 It is time to open the order
// +1 Late to open order
{
int Result=0;
if(TimeCurrent()<Open Time) Result=-1;
if(TimeCurrent()>=OpenTime+LateTime) Result=1;
return(Result;)
Print("sd",Result);
}

//-----------------Time to closed------------------------------------------------------------------------
datetime NeedToClosed=StrToTime("23:00");
datetime WeHaveChoice=60*10;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int TimeToClosed(datetime NeedToClosed,datetime WeHaveChoice)

{
int Result2=0;

if(TimeCurrent()<NeedToClosed) Result2=-1;
if(TimeCurrent()>=NeedToClosed+WeHaveChoice)Result2=1;
return(Result2);
}
int count()
{
int count=0;
{
for(int trade=OrdersTotal()-1; trade>=0; trade--)
{
if(OrderMagicNumber()==Magic)
count++;
}
}
return(count) ;

}





Открой новые возможности в MetaTrader 5 с сообществом и сервисами MQL5
Открой новые возможности в MetaTrader 5 с сообществом и сервисами MQL5
  • www.mql5.com
Задавайте вопросы по техническому анализу, обсуждайте торговые системы и улучшайте свои навыки программирования торговых стратегий на языке MQL5. Общайтесь и обменивайтесь опытом на форуме с трейдерами всего мира и помогайте ответами новичкам — наше сообщество развивается вместе с вами. Парный трейдинг. Ищу компетентного трейдера(ов...
 
Hi all, could you please tell me how to work with string array while interacting with dll(C++)?(pass in parameters and return from function) String, numbers...all sorted out, and number array works fine too. But string array...will soon hit the table with my head(( and for future reference - is it possible to pass/return objects from dll? Have a good day everyone.
 
Hello, could you please advise me, I am a novice trader, with a company ***. I traded with an analyst. Now I can't withdraw money from the platform, because they say I have to pay a commission for using the platform and forcopying trades. Please tell me whether such a commission exists or I am cheated? Just read everywhere is written that automatically debited from the account when funds are withdrawn. But I am asked to pay extra and then allegedly withdraw the money.
 

Hello.

Can you please tell me what kind of bug is going on in MT4 - the bars with the same opening and closing price are disappearing on the chart, i.e. they just can't be seen! Scan attached.

 
Aleks132018:

Hello.

Can you please tell me what kind of bug is going on in MT4 - the bars with the same opening and closing price are disappearing on the chart, i.e., they just can't be seen! I attach a scan.

This is not an error - this is you setting the colour of the bars incorrectly.

Right click on the chart and set the correct colour. If you don't get it right away, you can use one of the three standard colour schemes.

 
Vladimir Karputov:

This is not an error - you have not set the colour of the bars correctly.

Right-click on the chart and set the right colour. If you don't get it right away, you can use one of the three standard colour schemes.

Thank you! It helped.

 

Hello people!

Does anyone have a "quote writer" that comes from a broker?

... looked at "Quote Archive" in the terminal - only what can be seen inthe "data window" - open/close/min/max/volume prices

... that's not what you need (!)

We need ALL TICK QUOTES for each bar (at least text data).

Please advise - where to see it ?!!!
... or maybe someone recorded them "for yourself" ?! - please share at least 20-30 ticks records (1-2 bars = bull-medv) (for ANY period) :)
(need it for shallow analysis)

Thanks )

Просмотр и настройка графиков - Графики котировок, технический и фундаментальный анализ - MetaTrader 5
Просмотр и настройка графиков - Графики котировок, технический и фундаментальный анализ - MetaTrader 5
  • www.metatrader5.com
Графики в торговой платформе отображают изменение котировок финансовых инструментов во времени. Они необходимы для проведения технического анализа и работы советников. Они позволяют трейдерам наглядно следить за котировками валют и акций в режиме реального времени и моментально реагировать на любое изменение ситуации на финансовых рынках...
 
o8586_khamaganovalv:
Hello, could you please advise me, I am a novice trader, with a company ***. I traded with an analyst. Now I can't withdraw money from the platform, because they say I have to pay a commission for using the platform and forcopying trades. Please tell me whether such a commission exists or I am cheated? Just read everywhere is written that automatically debited from the account when funds are withdrawn. But I have been asked to pay in addition and then allegedly withdraw the money.
It's a scam, that's for sure. They can take a commission on what they earn. I don't think you'll ever see your money again... You didn't make a deposit with your own money, did you?
Reason: