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

 
Hello! I have a standard exposure indicator, I like everything in it, but it refreshes slowly and does not keep up with the terminal window. Maybe it could be improved to make it more dynamic?
 
Mislaid:

Are you sure about the problem statement?

Simply, there are options:

- Do not repeat the last message

- to ignore the outdated one (some time lag is set), i.e. the message must be repeated.

P.S. The first variant is a special case of the second, but it is much easier to implement. Your definition of the problem is also a special case of the second variant with infinite lag.

If it interests you, here is the solution of your problem.

We define two arrays: a text one, which stores messages, and an index one, for searching messages.

The index array is of int type. In the first dimension we write the checksum of the text message. In the second dimension we write the row number of the first array's message. Sort the index array by the first dimension.

We get a new message. Read its checksum. Use ArrayBsearch() to search for such a message. If it is not found, then the message is original. Add it to the array of messages, checksum with reference to the index array, remembering to sort it.

What are the options for the checksum? I'd take this one: take into account the number of characters and the checksum of the text. The checksum of the text, for example, is the sum of the character codes. Given recent changes, it cannot exceed 65 536*256. So, the checksum of the message could look like this:

The number of characters is multiplied by 10 million and the checksum of the text is added.


Thank you! Thank you very much for your help, but there are some questions:

1. "Simply, there are options:

- do not repeat the last message

- ignore an outdated one (some kind of time lag is set), i.e. you have to repeat the message." - of this I'm pretty sure.

2. can i have an example code of this array (what you described)? (sorry for the consumer request ;) )

 
rabanik:

Thank you! Much appreciated for your help, there are questions:

1. "Just, there are options:

- do not repeat the last message

- ignore an outdated one (some kind of time lag is set), i.e. you have to repeat the message." - of this I'm pretty sure.

2. can i have an example code of this array (what you described)? (sorry for the consumer request ;) )

Unfortunately for me, I don't have time to code the algorithm I described.

This is so, brainstorming, in the absence of a full-fledged ToR.

 

Mastering arrays.

Created an array.

I saved it in a folder.

I try to compile an Expert Advisor with an array, it produces errors

Here is the link to the Expert Advisor and error information

http://clip2net.com/s/3BVhZE2 - (click on the image at this link to enlarge it)

I would be very grateful if you could suggest how to fix the errors.

int mass[]={
1327003200      ,
1328645970      ,
1331064000      ,
1331582400      ,
1332273600      ,
1332360000      ,
1332792000      ,
1333137600      ,
1333656000      ,
1334779200      ,
1335816000      ,
1337630400      ,
1337803200      ,
1339704000      ,
1340827200      ,
1342209600      ,
1342468800      ,
1342641600      ,
1344888000      ,
1345233600      ,
1346443200      ,
1346875200      ,
1347480000      ,
1347998400      ,
1349985600      ,
1350676800      ,
1351627200      ,
1352404800      ,
1353960000      ,
1354219200      ,
1355428800      ,
1356638400      
};
 
solnce600:

Mastering arrays.

Created an array.

I saved it in a folder.

I try to compile an Expert Advisor with an array, it produces errors

Here is the link to the Expert Advisor and error information

http://clip2net.com/s/3BVhZE2 - (click on the image at this link to enlarge it)

I would be very grateful if you could suggest how to fix the errors.


Start learning English, it helps. It says it can't open the file, so it's not there.
 
Arepersonal messages from this forum (from early 2011 to the time of their disappearance) permanently deleted or can they be restored?
 
evillive:
Start learning English, it'll help. It says it can't open the file, which means it doesn't exist.

Thank you for your help.

Please tell me what I did wrong.


Why is there no file if I have created one?

1. I created an MQH file - inserted variable values as an array.

2. File - Save As - a folder window opened in which the software prompted me to save the file.

Named the file MASSIV - clicked save.

The MASSIV file with an MQH extension is saved by default in the incluide - Tods folder.

What have I done wrong?

Here is a link to the folder where MASSIV file is located.

http://clip2net.com/s/3BVv1Rn

There is no array file in the Tods folder for some reason.

http://clip2net.com/s/3BVv587

 
solnce600: Why don't you have a file, if I have created it?

1. Try in MetaEditor: File --> Open shared data folder. You will see the path to the folder. This issue has been discussed many times, here is a link, for example

2. Try it without include at first. When you will debug it, you will start to include.

3. Insert the sources here either using the SRC button above or the Attach File button below.

 

Good afternoon. I have a question: where can I see an example of code to output the values of one indicator from different timeframes on a price chart?

I cannot google it, maybe I am doing a wrong request.

I want to output in the second column in the price chart the standard deviation of the Bollinger Bands from H1 to W1. The second column shows values obtained by multiplying the standard deviation by the coefficients.

Bollinger Bands modified.

 
FiVik:

Good afternoon. I have a question: where can I see an example of code to output the values of one indicator from different timeframes on a price chart?

I cannot google it, maybe I am doing a wrong request.

I want to output in the second column in the price chart the standard deviation of the Bollinger Bands from H1 to W1. The second column shows values obtained by multiplying the standard deviation by the coefficients.

Bollinger Bands modified.

Keywords for codobase search "Multi timeframe".

Text can be displayed using OBJ_LABEL.

Reason: