[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 343

 
JackaLrus >> :

Could you please suggest a function to implement a dialog box where you can specify variable values.

For example, there is a buy script (buy with sl and tp set), when you run it, a dialog box is displayed where you can specify e.g. lot size, then press ok and the order is executed!

>> Thank you!

Write the preprocessor command #property show_inputs at the beginning of the script

 
Stepan241 писал(а) >>

int init()
{
//Write your pre-processing here.
return(0);
}


//+------------------------------------------------------------------+
int deinit()
{
return(0);
}

//+------------------------------------------------------------------+
int start()
{
return(0);
}
See if the template matches your EA. You are most likely missing a RED BRACTER.

Thank you. Template matches, double-checked brackets - found no open and closed matches

 
Urain >> :

Write the preprocessor command #property show_inputs at the beginning of the script

Thanks for the tip! But this is a little bit not what I would like. Is it possible to implement the output of exactly the dialog box, with lot selection? Thank you!

 
JackaLrus >> :

Thanks for the tip! But this is a little different from what I would like. Is it possible to implement output of dialog box with lot selection? >> Thank you!

At the start of the script you write

#property show_inputs

extern double Lot=0.1

then at the moment of attaching the script to the tool window a dialog box will appear. there you can enter the lot size

 

Hello. I have a question for the people who know the code of the indicator.

There is a cycle of counting the value of the i-th bar from Bars to 0 using the formula Z=(Close[i]-Open[i])/(High[i]-Low[i])*Volume[i];

As you can see, when counting i from Bars to zero, Z takes both positive and negative values.

Question - how to write code so that X[i]=Z[i]+X[i+1] and Y[i]=Z[i]+Y[i+1] values are counted, where X counts ONLY positive values of Z, and Y counts negative

Files:
ddu4.mq4  1 kb
 
Laven >> :

Hello. I have a question for the people who know the code of the indicator.

There is a cycle of counting the value of the i-th bar from Bars to 0 using the formula Z=(Close[i]-Open[i])/(High[i]-Low[i])*Volume[i];

As you can see, when counting i from Bars to zero, Z takes both positive and negative values.

Question - how to write code so that X[i]=Z[i]+X[i+1] and Y[i]=Z[i]+Y[i+1] values are counted, where X counts ONLY positive values of Z, and Y counts negative

Corrected the attached file

 
Laven писал(а) >>

Question - how to create code to calculate X[i]=Z[i]+X[i+1] and Y[i]=Z[i]+Y[i+1] values, where X counts ONLY positive Z values and Y - negative

I don't understand the structure of new arrays X and Y, or they are just variables, not arrays?

 
Roger >> :

The structure of the new X and Y arrays is unclear, or are they just variables, not arrays?

Maybe the question I asked earlier will clarify things more:

Hello. I am struggling with the code of a custom indicator based on the DeMark theory. The essence of the indicator - the way passed by the price (Close[i]-Open[i])/(High[i]-Low[i]) per unit time, for example a day, is multiplied by the volume of the same period. If the price goes up, the value of that value multiplied by the volume is added to the previous value. If the price goes down, the value of that day is subtracted from the previous day's value. In other words, positive values are added to the previous day's value and negative values are subtracted from the previous day's value. The correlation of positive and negative values of one period is the percentage expression of buyer/seller pressure, in other words the accumulation/distribution of given financial instrument.


The meaning of X and Y is that the array is built from the value of the ratio X/(X+Y)

 
Roger писал(а) >>

The structure of the new X and Y arrays is unclear, or are they not arrays, just variables?

Variables. I asked to give either arrays or variables different names. But apparently I was misunderstood.

Laven wrote >>.

Hello. I have a question for the people who know the code of an indicator.

We have a loop that counts the value of the i-th bar from Bars to 0 using the formula Z=(Close[i]-Open[i])/(High[i]-Low[i])*Volume[i];

As you can see, Z takes both positive and negative values when counting i from Bars to zero.

My question is how to write code to get X[i]=Z[i]+X[i+1] and Y[i]=Z[i]+Y[i+1] values, where X counts ONLY positive Z, and Y - negative

In fact, you should limit the volume of the analyzed history to some number of bars.

Then the values will fluctuate and not degenerate into a straight line.

I wanted the author to think through the logic of the indicator to the end, rather than ask others to think it through.

 

Please advise what caused the error and how to deal with it, occurs in the tester's log:

19:20:11 TestGenerator: unmatched data error (low value 1.3676 at 2009.05.13 00:00 and price 1.3676 mismatched)
19:20:11 TestGenerator: unmatched data error (high value 1.3696 at 2009.05.13 01:00 and price 1.3696 mismatched)
19:20:11 TestGenerator: unmatched data error (high value 1.3700 at 2009.05.13 02:30 and price 1.3700 mismatched)
19:20:11 TestGenerator: unmatched data error (high value 1.3700 at 2009.05.13 03:30 and price 1.3700 mismatched)

I tried deleting prices and uploading again, maybe I'm doing something wrong, in the code everything seems to be fine.