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

 
Reshetov:
Well, to give you a hint, the developers haven't yet implemented a time machine in the terminal to travel to and from the future. Or maybe I'm not aware of it.
That's a bit complicated, but thank you for that. I'll take your hint.
 
griha:

How can I write a script that would be guided by stochastic or RSI level (or preferably several indicators to choose from), so that at a given indicator level a given beep would be played? And better yet, it would have a choice of actions to be performed - to play a given sound signal, to place an order, to display a message on the screen. At least tell me the basic blocks of the script.

See Tutorial
 
eugggy:
It's complicated, but thank you. I'll take your hint.

You don't have to guess or figure it out, you just have to use your brain a bit. You have already answered your own question like this:

eugggy:
... we create 0, delete -1...
Substitute these numbers into the bar numbers.
 
Reshetov:

You don't have to guess or figure it out, you just have to use your brain a bit. You have already answered your own question like this:

Put these numbers in the bar numbers.
Thank you, I will do so.
 
ask: I didn't claim to be good at programming. Not my profile. However, we are not discussing my programming abilities and gerrymandering (which, though extremely modest, allow me to get what I need), but your rudeness. People of different backgrounds, ages and skills are on the forum. To refer someone to the "telepathic club" is to contextually indicate to the person that they are a fool. If your mental faculties don't allow you to understand a question clearly enough

Oh, that's a lot of emotion. Let's get it straight from the beginning, whether anyone is capable of understanding your question enough to answer it. So:

Hello, perhaps someone has a piece of code that from the posterior combinations (you can placements) finds the right ones?

I sent you to the telepaths. By sending you there, I didn't call you a fool (that's just what you think). I simply hinted at an unclear formulation of the problem that prevents you from giving a proper answer. What I got from you was this:

Do you have to be sarcastic? I did not go to a telepath, tried to scribble myself, came out as it turned out (not a programmer), but maybe someone will need.

I do not understand the reason for your unmotivated aggression, you asked just a piece of code (from the script, the advisor, whatever) of the number of permutations (or combinations, whatever) from the school course of combinatorics, which derives the desired from the posteriori data, just that is a reason for inadequate behavior?

What followed was a piece of code (see your post at https://www.mql5.com/ru/forum/134688/page504) about which I could only understand that you were going to do brute force over a 4-dimensional parameter space. The code does not work, of course. I still haven't got a specific question from you. But now you feel deeply offended because I sent you to telepaths.

OK, then here are some specific questions from me for you to at least understand something. No need to refer me to a high school course in combinatorics, I remember it.

1. What specific meaning do you give to the expression "a posteriori data"?

2. What is "necessary" in the context of the problem? What is the criterion of usefulness?

In short, the very definition of the task is very vague and unspecific. But the programmer is writing code to solve a particular task. What else don't you understand, you offended man?

 
Mathemat:

Oh, that's a lot of emotion. Let's get it straight from the beginning, whether anyone is capable of understanding your question enough to answer it. So..:

I sent you to telepaths. When I sent you there, I did not call you a fool (only you think so). I simply hinted at a vague formulation of the problem, which does not allow you to give a normal answer. What I got from you was this:

What followed was a piece of code (see your post at https://www.mql5.com/ru/forum/134688/page504) about which you only understood that you were going to do brute force over a 4-dimensional parameter space. The code does not work, of course. I still haven't got a specific question from you. But now you feel deeply offended because I sent you to telepaths.

OK, so here are some specific questions from me for you to at least understand something. No need to refer me to a high school course in combinatorics, I remember it.

1. What specific meaning do you give to the expression "a posteriori data"?

2. What is "necessary" in the context of the problem? What is the criterion of usefulness?

In short, the very definition of the task is very vague and unspecific. But the programmer is writing code to solve a particular task. What else don't you understand, you offended man?


1. I don't want to talk to you about the categories of a priori and a posteriori in the Kantian sense, which is unnecessary. But for any person the a posteriori is the received after experience (unlike the a priori). Forgive me for having to clarify for you with the help of the Russian dictionary: http://feb-web.ru/feb/mas/mas-abc/01/ma104224.htm So "a posteriori data"-data obtained in the course of an experience/experiment.

2. Although you called the code unworkable only because equals and unfilled arrays and other things were removed from it (since the obviousness of filling them for a particular task does not cause any difficulties), I will still give you the same code. And believe me (check it out) it works. It may not be brilliantly written, but it works for my needs.

Here is a simple example:

Suppose we flip a coin 6 times, let's label heads as 1, tails as 2. Find all cases in which the first and third flip, as well as the fourth and sixth show the same sign (heads or tails), and (as can be seen from the "not working code"), the first two comparisons are independent of each other (mb OO and RR)

//+------------------------------------------------------------------+
//| ременный.mq4 |
//| Copyright © 2012, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
int array[2][2][2][2] = {1,2,

1,2,

1,2,

1,2};

int array1 = {1,2,

1,2};

for(int q = 1; q <= 2; q++)
{
for(int w = 1; w <= 2; w++)
{
for(int e = 1; e <= 2; e++)
{
for(int r = 1; r <= 2; r++)
{
for(int t = 1; t <= 2; t++)
{
for(int y = 1; y <= 2; y++)
{



if (q==e && r==y)



MessageBox("имеем: ["+q+"]["+w+"]["+e+"]["+r+"]["+t+"]["+y+"].....");



}}}}}}
//----
return(0);
}
//+------------------------------------------------------------------+

You, without understanding, are rude to strangers not only sending everyone away, but also talk about something not working (I'm not claiming that I found the best solution to the problem) but the problem is solved. And it doesn't matter how concise the process is (the code is optimized), it's the result that counts.

I don't have impudence to refer you to a school course of combinatorics (don't attribute me your inclinations), I'm sure you know it, and even better than me (I never take anyone as intellectually inferior to me, on the contrary), but I will simply once again pay your attention to my first post

Hello, maybe someone has a piece of code that finds the right ones from the posterior combinations (you can place them)?

What can be incomprehensible to a person I do not know. Neither do I understand what caused the aggression and boorishness (you could have just ignored it), if somebody else had answered or if I had fixed it myself - don't you care?

 
ask: Suppose we flip a coin 6 times, designate heads as 1, tails as 2. Find all permutations in which the first and third flip, as well as the fourth and sixth show the same sign (heads or tails), and (as seen from the "not working code"), the first two comparisons are independent of each other (mb OO and RR)

Well, finally I see a concrete problem with a clear concept of "the right ones" and an attempt to solve it. You probably don't mean shuffles, but rather a series of trials of 6 throws?

Yes, such problems can rarely be solved except by simple brute force, especially when one has to explicitly show all such series, and not just to count their number.

OK, what exactly is the problem you need to solve?

P.S. And stop talking about aggression/hammering. They didn't happen, you made them up yourself.

 
Mathemat:

Well, finally I see a concrete problem with a clear concept of "the right ones" and an attempt to solve it. You probably don't mean shuffles, but rather a series of trials of 6 throws?

Well, yes, such zadachas are rarely solved except by simple brute force, especially when you need to explicitly show all such series, and not just count their number.

OK, what particular problem do you need to solve?

P.S. And stop talking about aggression/humour. They didn't happen, you made them up yourself.


Thank you, but I've already made up my mind. Yes, let's consider the argument over. Perhaps I misunderstood you as well as you misunderstood me. It's settled. Thank you again.
 
Hello. How can I display the maximum High value for a certain period in the indicator?
 
david2:
Hello. How can I display the maximum High value for a certain period in an indicator?

int iHighest( string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)

Returns the index of the highest value found (offset relative to the current bar).
Parameters:
symbol - Symbol name of the symbol, the data of which will be searched. NULL means current symbol.
timeframe - Period. Can be one of the periods of a chart. 0 indicates the period of the current chart.
type - The identifier of the timeseries. Can be any of the timeseries identifiers.
count - Number of elements of the timeseries (in the direction from the current bar to the ascending index), among which the search should be performed.
start - The index (offset from the current bar) of the start bar from which the search for the highest value will start. Negative values are ignored and replaced by a zero value.
Example:
 double val; // calculate the maximum price value on 20 consecutive bars // from index 4 to index 23 inclusive on the current chart val=High[iHighest(NULL,0,MODE_HIGH,20,4)];
Reason: