Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 791

 

I also have a question for the experts. I have not dealt with indicators before.

Is it possible to draw the balance by mode chart in a separate window, but without binding to the bars?

It means that a curve line like the one drawn in the strategy tester should be drawn in one window.

 

Hello Dear Professionals. The question is that in the old build 509 there was the following function

#import "wininet.dll"
   int InternetOpenA(string a0, int a1, string a2, string a3, int a4);
   int InternetOpenUrlA(int a0, string a1, string a2, int a3, int a4, int a5);
   int InternetReadFile(int a0, string a1, int a2, int& a3[]);
   int InternetCloseHandle(int a0);

int function1inet() {
   int IOURez;
   bool Rez = TRUE;
   string IOAgent= "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)";
   bool IOAccess = FALSE;
   int IOSes = InternetOpenA(IOAgent, IOAccess, "0", "0", 0);
   if (IOSes != 0) {
      IOURez = InternetOpenUrlA(IOSes, "http://www.site.ru", "0", 0, -2080374528, 0);
      if (IOURez == 0) Rez = FALSE;
      else InternetCloseHandle(IOURez);
      InternetCloseHandle(IOSes);
   } else Rez = FALSE;
   return (Rez);
}

Since in the new builds strings are now a sequence of Unicode characters and now I have to use InternetOpenW and InternetOpenUrlW .

Using WebRequest doesn't get the same result.
 
T-G:

Hello Dear Professionals. The question is that in the old build 509 there was the following function

Since in the new builds strings are now a sequence of Unicode characters and now I have to use InternetOpenW and InternetOpenUrlW.

Using WebRequest does not get the same result.

so what's the problem? I think the solution is already highlighted in bold...

#import "wininet.dll"
int InternetAttemptConnect(int x);
int InternetOpenW(string sAgent,int lAccessType,
                  string sProxyName="",string sProxyBypass="",
                  int lFlags=0);
int InternetOpenUrlW(int hInternetSession,string sUrl,
                     string sHeaders="",int lHeadersLength=0,
                     int lFlags=0,int lContext=0);
int InternetReadFile(int hFile,uchar &sBuffer[],int lNumBytesToRead,
                     int &lNumberOfBytesRead[]);
int HttpQueryInfoW(int hRequest,int dwInfoLevel,
                   uchar &lpvBuffer[],int &lpdwBufferLength,int &lpdwIndex);
int InternetCloseHandle(int hInet);
#import
 
tuner:
What exactly are you interested in - just a transfer to breakeven?
You need to close part of the position. And during the next pass this position will not be touched. And I do not want to be bound to the lot size. We should mark this order and filter it in the loop. Maybe, we should memorize ticks in some way. I don't know yet. Problem
 
Gobsek:
Specifically, a part of the position should be closed. And, during a next pass, this position will not be moved at all. And I don't want to be bound to the lot size. We should mark this order and filter it in the loop. Maybe, we should memorize ticks in some way. I don't know yet. Problem

Then link to the comment. For those that were closed partially (reopened) in the comment will be written the ticket of the position from which this one occurred, for example:

Was position Buy #12345 with lot 0.1, became position Buy #12346 with lot 0.05. In the last one in the comment will be written "from #12345".

If you find in the history, in the list of closed orders with ticket #12345, in its comment will be written "to #12346".

Thus, when checking comments of open positions and corresponding closed orders, you can find the first, parent order (if there were multiple partial closures)

 
Good day! Can you please tell me how to average in Metotrader 4 as a newbie? In Metotrader 5, you place a bid and prices are automatically averaged. How do I do it in 4?
 
artmedia70:

Then bind to the comment. For those that were closed partially (reopened) in the comment will be written the ticket of the position from which this one occurred, for example:

Was position Buy #12345 with lot 0.1, became position Buy #12346 with lot 0.05. In the last one in the comment will be written "from #12345".

If you find in the history, in the list of closed orders with ticket #12345, in its comment will be written "to #12346".

Thus, when checking comments of open positions and corresponding closed orders, you can find the first, parent order (if there have been multiple partial closures)

Interesting !!! I will try in this direction. Thanks !
 

Good afternoon.

How do I know when a candle is closed and a new candle has started to form?

Ozero.
 
Ozero:

Good afternoon.

How do I know when a candle is closed and a new candle has started to form?

Ozero.
Thetime of candlestick formation has changed
 

I want to make an EA to open a certain number of buy and sell orders at a certain distance.

int pendord()

{
int t = 0;
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if( OrderSymbol()!=Symbol() || OrderType() != OP_BUYSTOP ||
OrderType()!= OP_SELLSTOP)continue;
{
t++;
if(nOrders < t*2)

{
OrderSend(Symbol(),OP_SELLSTOP,lot,Ask - (opdist + mn)*Point,3,Ask - (opdist + mn)*Point + sl*Point,Ask - (opdist + mn)*Point - sl*Point,",mn,0,Red);
}
else if(nOrders < t*2)
OrderSend(Symbol(),OP_BUYSTOP,lot,Bid + (opdist + mn + 1)*Point,3,Bid + (opdist + mn + 1)*Point - sl*Point,Bid + (opdist + mn + 1)*Point + sl*Point,",mn + 1,0,Blue);
}
mn +1;
}}

return(o);
}