[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 214

 
gheka:

Hi folks, I haven't been here in a while (1.5 years) could you refresh my memory a little?

My point is that with the help of Expert Advisors the orders were placed with t/p and s/l. Now I want to close the necessary orders without them.

Warrants.

here is the code


int clos(int mn)
{ int k=OrdersTotal();
for(int a=0;a<=k;a++)
{ if(OrderSelect(a,SELECT_BY_POS,MODE_TRADES))
{ if(OrderMagicNumber()==mn)
{ if(OrderType()==OP_BUY || OrderType()==OP_SELL)


int n=OrderTicket();

double l=OrderLots();

OrderClose(n,l,Ask,5,0);

}}}

return(0);

}


I don't close any order, I passed all of them, what's wrong?

Choose the fi ries from the second page, plug them into your owls - the wheel was invented a long time ago. :-)
 

Good afternoon.

Can you help me to complete this code, I need to memorize this bar when Spread is equal to zero.

and then control the Spread. if it is greater than a certain value open a deal.

int razdvizka =20;

int Price1, Price2, Spread;

for (int m=1;m<Bars;m++)
{

Price1 =(iClose(Symbol_1,0,0) - iClose(Symbol_1,0,m)) / MarketInfo(Symbol_1, MODE_POINT);
Price2 = K*(iClose(Symbol_2,0,0) - iClose(Symbol_2,0,m)) / MarketInfo(Symbol_2, MODE_POINT);
Spread = Price1 - Price2;
if (Spread==0) {......... }
}

Price1 = (iClose(Symbol_1,0,0) - iClose(Symbol_1,0,m)) / MarketInfo(Symbol_1, MODE_POINT);
Price2 = K*(iClose(Symbol_2,0,0) - iClose(Symbol_2,0,m)) / MarketInfo(Symbol_2, MODE_POINT);
Spread = Price1 - Price2;

if (Spread> razdvizka ) { open trade }

 

Hi.

Could you please tell me if mql4 has http upload functions?

if so, what kind of functions?

 

Hello Gentlemen)) The situation is as follows,

the signal "sig1" triggers the command BAY and sets a pending order SELLSTOP below the order BAY.

When I close a BAY position, the SELLSTOP is also deleted.

What happens when the BAY has not been closed and the next BAY has been opened, and so on.

This SELLSTOP which is set first has to be calculated in order to perform any operation with it.

 
nikz:

Hi.

Could you please tell me if mql4 has http upload functions?

If so, what kind of functions?

not directly...

you can only SendMail() - either a letter to a mailbox.

void SendMail( string subject, string some_text)
Sends an email to the address specified in the settings window on the "E-Mail" tab.
Sending may be prohibited in the settings, also the email address may not be specified. The GetLastError() function should be called to get the error information.

or file via ftp
bool SendFTP( string filename, string ftp_path=NULL)
Sends file to email address specified in settings window in Publish tab. Returns FALSE if not successful.
The function doesn't work in test mode. This function also cannot be called from the custom indicators.
The file to be sent must be located in the terminal_directory\experts\files folder or its subfolders.
Sending is not performed if no FTP address and/or access password is specified in the settings.

----
But - no one is stopping you to write such a function in another programming language (which you need) and use it in a DLL.





 
Aleksander:

not directly...

You can only send information - either a letter to a mailbox

void SendMail( string subject, string some_text)
It sends an email to the address specified in the settings window on the "E-Mail" tab.
Sending may not be allowed in the settings, also the email address may not be specified. The GetLastError() function should be called to get the error information.

or file via ftp
bool SendFTP( string filename, string ftp_path=NULL)
Sends file to email address specified in settings window in Publish tab. Returns FALSE if not successful.
The function doesn't work in test mode. This function also cannot be called from the custom indicators.
The file to be sent must be located in the terminal_directory\experts\files folder or its subfolders.
Sending is not performed if no FTP address and/or access password is specified in the settings.

----
But - no one is preventing you, in another programming language, write such a function (which you need) and use it in a DLL

Thanks for the tip, but these functions send info/file, not receive
I'm just trying to avoid it, it's too far for my brain to handle.

It is interesting, for example, the Urdala_News indicator shows time of news releases and has a dll import, but no dll file was added to sq4 file of the indicator.





 
Need an indicator or script that would show candle boundaries on a lower timeframe from a higher timeframe. If anyone knows, please give me a link
 
nikz:

Hi.

could you please tell me if mql4 has http upload functions?

If so, what kind of functions?

Through wininet.dll, see how it is done here.

Do you mean the functions

#import "wininet.dll"
int InternetAttemptConnect (int x);
  int InternetOpenA(string sAgent, int lAccessType, 
                    string sProxyName = "", string sProxyBypass = "", 
                    int lFlags = 0);
  int InternetOpenUrlA(int hInternetSession, string sUrl, 
                       string sHeaders = "", int lHeadersLength = 0,
                       int lFlags = 0, int lContext = 0);
  int InternetReadFile(int hFile, int& sBuffer[], int lNumBytesToRead, 
                       int& lNumberOfBytesRead[]);
  int InternetCloseHandle(int hInet);
#import

UPD read your previous post - wininet.dll is a standard Windows library, so don't worry about its presence in the system.

 
Top2n:

Hello Gentlemen)) The situation is as follows,

the signal "sig1" triggers the command BAY and sets a pending order SELLSTOP below the order BAY.

When I close a BAY position, the SELLSTOP is also deleted.

What happens when the BAY has not been closed and the next BAY has been opened, and so on.

This SELLSTOP which is set first has to be calculated in order to perform any operation with it.


Each order has a unique number called OrderTicket(). This can be used to track it down.
 

Good day!

I tried to write an EA recently, everything turned out almost normal, opens transactions by time.

The problem now is the time, for example, need to open a deal at 8 34 and the bar is not, looked at the minute goes first 8 33 then immediately 8 35, analyzed another chart, I noticed that some of the minutes just as there.

Please advise how to reopen the position in a minute, etc., until 1 trade opens.

If you would like to reply to aksa33@mail.ru, thank you very much.