Market condition - flat or trend? Which dominates? - page 12

 
A new version of the flawed komposter script. The main difference is a comment with an explicit reference to the fact that the prototype script has been corrupted. Also the misleading output has been removed and a symbol added to the filename. Old versions have been removed.
 

I made an indicator for visualization of the data from the file. Of course, the data should be preliminary written to this file using the TrendFletAnalysis_2mS_1.mq4 script. When reviewing, you should also consider the time scales and ranges. For example, if you write the file with the parameters ind_Points=20, ind_Percent=0.0, Sample=100 on the one-minute chart, then on the daily chart the indicator will show


P.S.

Xadviser:
How do I get such a picture? I just get a statistical report

Hm, I thought you had more skills with statistics. The data is written to a file, then this file needs to be found and imported into your favourite data program (my pictures are made in Matlab). It is also desirable to be able to determine the format of the data file from the text of the script. In our case it is defined with the following line

FileWrite(hndl,Time[i],trend_perc,flet_perc,trend_perc_height,flet_perc_height);

This line tells us that each line of data file contains 5 numbers. Which of them will be printed is specified by the Column parameter of the indicator. If Column=2 it will display trend_perc, if Column=3 - flet_perc, etc.


P.P.S. The post was edited with the replacement of the picture and attached file at 13:10

Files:
 
lna01:

Made a data visualisation indicator from a file.

Thanks a lot. Do the segments count with the corrections I pointed out in the post (04.04.08 17:26)? Applies to flats.

By the way, do you see support and resistance lines, double and triple tops, triangles, studs, trends and flats on the resulting chart? ;)

This feature is very useful. In fact, it is a variant of the distribution I was talking about. It is one thing to calculate the mean value and enjoy the feeling of "how beautiful everything is". But the market has surprises. You have to be prepared for them. In this case, you should know by how much (as in the past) we can deviate from the average and take this factor into account. Also we need maximum sequences of segments by number, length (in bp) and time (in bars) on the whole studied area.

Do I understand correctly that if we change the reference point, the visualization indicator plot may change? I.e. in each new sequence of 100-ten segments a different sequence of the segments themselves will appear?

Hmm, I thought you had more skills with statistics.




Yes I am a Lamer and ChineG in general (:0 Making a programmer out of me is a hopeless case. But anything you cited I think would not be useless. "You never know when a dead rabbit will come in handy" (C) Alfred Hitchcock.

Programming is like reading a book of china to me. I consider myself a practicing trader. For successful trading I consider the knowledge of statistics on the level of Gaussian distribution and probability distribution from the TheoVerse event space to be sufficient. I came here, because I'm tired to sit behind the monitor all day long. Life goes on....

 
lna01:
A new version of komposter's flawed script. The main difference is the comment explicitly pointing out the fact that the prototype script is defaced. Also the misleading output has been removed and a symbol added to the filename. Old versions have been removed.

At compile time writes Function "_LabelCreate" is not referenced and will be removed from exp-file

Is that OK? And if you don't mind, can you be more clear about what is written in the quote?

And ShowTFAData_1.mq4 doesn't show the chart. Maybe I am doing something wrong? I have run TrendFletAnalysis_2mS_1.mq4 on minutes. Switched to Daley, started ShowTFAData_1.mq4 window opens, but no chart :-(


 
Xadviser:

By the way, do you see support and resistance lines, double and triple tops, triangles, studs, trends and flats on the resulting chart? ;)

Actually, all these things are somehow found on almost any graph, including graphs obtained with a pseudorandom number generator (there was a topic here recently) :)

Do I understand correctly that when you change the reference point, it is possible that the visualisation indicator chart will change? I.e. each new sequence of 100-ten segments will have a different sequence of segments themselves?

Right. But since these are variations around the same distribution, most likely the changes won't be fundamental. Although the "support-resistance" lines may change. By the way, it is possible to decrease Sample parameter - in theory the graph will become more indented, but the time localization will improve.
Xadviser:
lna01:
A new version of komposter's flawed script. The main difference is a comment explicitly pointing out the fact that the prototype script has been corrupted. Also misleading output was removed and a symbol was added to the filename. Old versions have been removed.

At compile time writes Function "_LabelCreate" is not referenced and will be removed from exp-file

Is it ok? And if you don't mind, can you explain more clearly what is written in the quote?

And ShowTFAData_1.mq4 doesn't show my chart. Maybe I am doing something wrong? I have run TrendFletAnalysis_2mS_1.mq4 on minutes. Switched to Daley, started ShowTFAData_1.mq4 window opens, but no chart :-(

Since I reshaped the script "with an axe and chisel without a nail", the statistic that has been printed is not the final one. Therefore, there is no point in printing it out. The function "_LabelCreate" was just used to print it out and this message means that it is no longer used. So, it's not an error - an extra part has just appeared as a result of disassembly-assembly :). The name of the data file created is displayed in the comment when the script finishes, it contains information that uniquely identifies the data set: the symbol on which it was calculated and the values of the script parameters at the time of calculation.

If you have the right data file, the reason for the lack of a visible graph may be a range slip. For example, if ind_Points=100 and Sample=100, I got only two points for three years.


The segments are calculated the way komposter did it. I only inserted what I was interested in - calculating the data on successive sections of history in order to see the dynamics, both "horizontal" (by time) and "vertical" (by zigzag threshold).

 
lna01:

Right. But since these are variations around the same distribution, the changes are not likely to be fundamental. Although the "support-resistance" lines may change. By the way, you can decrease Sample parameter - in theory the graph will become more indented, but the localization by time will improve.

And how is the reference point set? Can it be changed? Does TrendFletAnalysis_2mS_1.mq4 calculate by time or by value?

The name of the generated data file is displayed in the comment after the script finishes, it contains information that uniquely identifies the data set: the symbol on which it was calculated and values of the script parameters at the time of calculation.

If you have the right data file, the reason for the lack of a visible graph could be a range slip. Say, at ind_Points=100 and Sample=100 I got only two points for three years.

This is all displayed, but the graph is still not displayed. ind_Point has been set differently. What is Column in ShowTFAData_1.mq4? The default value is 2.

Maybe, there is something wrong with the sequence of my actions?

The segments are calculated the way komposter did it. I only inserted what I was interested in - calculation of data on successive segments of history in order to see the dynamics, both "horizontal" (by time) and "vertical" (by zigzag threshold).

I've mentioned that some changes should be made in the calculation for more correct calculation of the flat components.

Do you find this topic useful?

 
Xadviser:

How is the reference point set? Can it be changed? Does TrendFletAnalysis_2mS_1.mq4 count by time or by value?

It counts from the beginning to the end of the available history. It is easy to set the start date. The version is attached. Additionally it now tells you how many points have been written to the file. Also a new version of the indicator - draws a little differently.

It all is displayed, but the chart is still not shown. I have set different ind_Points. What is Column in ShowTFAData_1.mq4? The default value is 2.

Maybe, there is something wrong in the sequence of my actions?

About the Column parameter I wrote above. If the indicator does not complain that the required file is missing, the sequence is correct. If the date range of the daily chart covers the range of the minute chart and there is at least one point, the new version should display something. If not, you need to see if anything is written to the terminal and Expert logs.
I've noticed that there should be some changes in the calculation for more correct calculation of the flat components.

Do you think this topic is useful?

The topic is of limited interest to me at the moment, i.e. I don't want to spend excessive time on it.
 

And indicator


P.S. Just in case: the indicator parameter values must match the script parameter values at which the data set to be visualised has been calculated.

Files:
 
lna01:

P.S. Just in case: the indicator parameter values should coincide with the values of the script parameters, at which the data set to be visualized has been calculated.

It is clear. It all worked out. Unfortunately, I have a small number of points drawn. I suspect that there is not enough history, although I seem to have tried to upload it. Maybe you can suggest me a more effective way?
On what TF should I run the script? Is it necessary to run it on the minutes?
As for the new version, I am very satisfied with the result. It "correctly" draws now. I think horizontal levels show dynamics more correctly.

I would like to improve it to "perfection" (if possible).

  • the possibility of selecting the TFS by value or in points. Can it be possible to combine in one window?
  • Display the distribution (along the vertical axis), indicate the maximum and 2 sigmas on it (it would be good to be able to set the desired sigma size)
 
Xadviser:

It's understandable. It all worked out. Unfortunately, I'm drawing a small number of dots. I suspect that there is not enough history, although I seem to have tried to upload it. Maybe you can suggest me a more effective way?

Yes, it seems to have worked by uploading through the History Centre. Since the middle of 2004 it is possible to take minutes from Alpari. There are also other sources. In general on this forum search works, you can find a lot of useful things.
On what TF should I run the script? Is it necessary on the minutes?
This script should work on any timeframe. It's just that on the minutes the time is calculated with one minute accuracy. But on the hour ones it is accurate to one hour.
Can I select the TFs by value or in pips? May it be possible to combine in one window?

This is the easiest one. You should find the indicator in the Navigator window and drag it with your mouse to the window of the previously started indicator. If we now set Column = 4, it will draw a picture for the relationship in pips. The colour of the lines should also be different. The result should be something like this

Display the distribution (along the vertical axis), and indicate maximum and 2 sigmas on it (it would be nice to be able to set the size of sigmas as needed)

All this is of course possible. And a lot more can be done. That's why you need motivation to do something. If you're just "curious to see", there are alternative solutions:

- Mastering some data program.

- Convince the developers to add these features to the terminal :)

- Get a job as a programmer.

If you see definite use for trading, then on this forum a lot (and not just once) discussed the normal distribution (sigma is just for it) and forex, I recommend trying to find this wealth with a search and at least have a quick look at it.

Reason: