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

 


Hi all, I would like to ask this question. There is a pair like eur/usd/ but can we make the opposite pair? usd/usd/? I'd love one.

 
gyfto:

Log says function 'GetModuleFileNameA' call from dll 'kernel32.dll' critical error c0000005 at 7C902128 in case of declaration by string. I still don't understand why. On the surface - terminal crashes about 3-7 seconds after opening, no time to write anything in logs, i.e. terminal closes not by itself.

The string must be initialised:

string sBuf = "                           "; // Примерно так.

Dimass90:


Hi all, I would like to ask this question. There is a pair like eur\usd/ but can we make the opposite pair. usd\ur/?

Can:

USDEUR = 1 / EURUSD

 
Zhunko:

The string needs to be initialised:

Stood like this:

...
nSize=255;
string lpFileName;

int init()
  {
   for(int i=0; i<nSize; i++){
      lpFileName = lpFileName + " ";
    }
   return(0);
  }

int start(){
   ...//после получения sizeFileName
   lpFilename = StringSubstr(lpFileName, 0, sizeFileName-1);
//дальше Print

The log received at best "lpFileName=_255 spaces_"...

 
Zhunko:

The string must be initialised:

Can:

USDEUR = 1 / EURUSD

Is this a script that needs to be changed? I don't understand(

 
Help I have encountered a situation where there are two fractals on the same candle - up and down. Is it a glitch or is it normal?
 
gyfto:

Stood like this:

The log was getting at best "lpFileName=_255 spaces_"...

Wrong. Correct, as shown above.
 
Dimass90:


Hi all, I would like to ask this question. There is a pair like eur/usd/ but can we make the opposite pair? usd/usd/? I'd love one.

No, you can't. It's up to the world bank chiefs to set the currency symbols.
 
Dimass90:

is it a script that needs to be changed?


If you use an indicator, then divide one by everything that has a value to the price in the predefined variables: open, close, high, low, bid, ask. If on candlesticks, it will be similar to the rangebars on a separate window (M2, etc.).

Usual_Trader:
Can you advise, I have encountered a situation where there are two fractals up and down on the same candle. Is it a glitch or is it normal?

It's normal, it happens, look at the history. Somewhere here it was even explained why. Why worry, the price will not go in two directions at the same moment, unless of course there is an external candle that breaks through two fractals at the same time)))

 

Help with the script. The Bars function returns a random number at each tick. The code is like this

void start()
        {
        LastBar = Bars;
        Print(LastBar, " ", Bars);
        
        while(LastBar >= 1)
                {       
                Print(LastBar);
                LastBar--;
                }
        }

I have exactly 517 bars on the chart.

When I run the Expert Advisor on the chart, it returns random numbers in the journal and skips the first Print function beginning from the one in the loop. However, the log shows that the loop does not reach the end, i.e. up to number 1, it may write numbers around 180 and immediately starts writing numbers over 250. And it looks like this

217 - 216 - 215 - 214 - 213 - 212 - 211 - 243 - 242 - 241 - 240 - 227 - 226 - 225 - 224...

If we remove the while loop from the function, the first Print function always outputs the exact number of bars. it always writes 517. Like this

void start()
        {
        LastBar = Bars;
        Print(LastBar, " ", Bars);
        
        }
 
sss2019:

Help with the script. The Bars function returns a random number at each tick. The code is like this

I have exactly 517 bars on the chart.

When I run the Expert Advisor on the chart, it returns random numbers in the journal and skips the first Print function beginning from the one in the loop. However, the log shows that the loop does not reach the end, i.e. up to number 1, it may write numbers around 180 and immediately starts writing numbers over 250. And it looks like this

217 - 216 - 215 - 214 - 213 - 212 - 211 - 243 - 242 - 241 - 240 - 227 - 226 - 225 - 224...

If we remove the while loop from the function, the first Print function always outputs the exact number of bars. it always writes 517. Like this

Do not look at the log in Metatrader, but right-click "Log-Open" and then use Notepad or something similar.