[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 181

 

Hi all!


My question is from a newbie.

I have an indicator that displays data from external files on a chart. Here are my questions:

1. How do I open the standard file selection dialog box?

2. How to bypass the restriction on the folders from which the files from the code can be opened (experts/files)?

3. How to make a control on the chart that can be clicked to disable the script. The main question is how to make an EA, for example some kind of button or something else to interact with the user through it)?


Thanks!

 

Explain to the nerd what the error is!

I am making a simple script on Finam demo to show Alert(BId) price;

All works, but for some reason the price is displayed with 4 decimal places, although the quotes are in 5 decimal places for EURUSD. IMA is also calculated with 4 decimals and not 5.

What I'm doing wrong, please advise????

 
Onesto:

Explain to the nerd what the error is!

I am making a simple script on Finam demo to show Alert(BId) price;

All works, but for some reason the price is displayed with 4 decimal places, although the quotes are in 5 decimal places for EURUSD. IMA is also calculated with 4 decimals and not 5.

Please advise me what I'm doing wrong ????

You are doing everything right, but terminal will print 4 decimal places, convert double to string before print with correct number of digits.

Alert(DoubleToStr(Bid,Digits));

 
sanderz:

Hi all!


My question is from a newbie.

I have an indicator that displays data from external files on a chart. Here are my questions:

1. How do I open the standard file selection dialog box?

2. How to bypass the restriction on the folders from which the files from the code can be opened (experts/files)?

3. How to make a control on the chart that can be clicked to disable the script. The main question is how to make an EA, for example some kind of button or something else to interact with the user through it)?


Thanks!

1-2.Standard is what? Although in any case, for the first two questions, you will need to use WinAPI and / or external DLL.

3. Directly from the script to make a graphic item in the loop to track its coordinates and when you drag it, the script will pause or unload.

The easiest way to do this is to look at the source code, the codebase is full of visual gizmos.

 
Dear forum members, can you help me output a table of all transactions from Quicksilver to excel so that it is updated online and so that I can change the number of displayed rows. I've tried but the whole table is displayed and not updated.
 
splxgf:

1-2. which one is the standard one? But in any case, the first two questions will require WinAPI and/or external DLL.

3. Directly from the script to make a graphic element in the loop to track its coordinates and when you drag it, the script will pause or unload.

The easiest way to do this is to look at the source code, there are plenty of visual gimmicks in the codebase.

Thanks.
 
splxgf:

You are doing everything correctly, but the terminal outputs 4 decimal places, convert double to a string before outputting it with the right number of digits.

Alert(DoubleToStr(Bid,Digits));


Thank you, I understand now.

When calculating in the Expert Advisor body, does the data come with 5 or 4 digits?

 
Onesto:


Thank you, now I understand.

And when calculating in the EA body, does the data go with 5 or with 4?

The calculations are performed with the normal number of digits, which is checked with Alert(Bid*100000);
 

Dear, I have a question again:

double hc=(iHigh(NULL,0,1)-iClose(NULL,0,1));
double cl=(iClose(NULL,0,1)-iLow(NULL,0,1));

if((iClose(NULL,0,1)<iOpen(NULL,0,1))&&(hc>cl))

pre12=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,0,Ask+100*Point,"",0,0,CLR_NONE);


There is a problem: positions are opened 17-40 times every 1 minute, although I test them on 15-minute charts. And the order is supposed to open no more than once every 15 minutes. Only then the condition of the previous candle's close being lower than its open one is fulfilled.

Why is it so?

 
NaVolne:

Dear, I have a question again:

if((iClose(NULL,15,1)<iOpen(NULL,15,1))&&(hc>cl))

pre12=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,0,Ask+100*Point,"",0,0,CLR_NONE);


There is a problem: positions are opened 17-40 times every 1 minute, although I test them on 15-minute charts. And I assume that an order should not open more frequently than once every 15 minutes. Only then the condition of the previous candle's close being lower than its open one is fulfilled.

Why is it so?


I assume that the order must be opened once every 15 minutes, at the beginning of

in the variable declaration area

double OpenBar=0; 

 

int start()
   {
    //Проверка на начало нового бара
    double CurOpenBar=iOpen(NULL,PERIOD_M15,0);  
    if (OpenBar==CurOpenBar) {return;} else {OpenBar=CurOpenBar;}
    //ваш код
   }


something like that...

But your condition is fulfilled on every tick, so the order opens on every tick...

Reason: