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

 

I apologize at once for my ignorance in maths :-)

Excerpt from book: "During execution of an assignment operation: first, the type of expression A+Y will be casted to int (according to the rule of integer evaluation)".

Question: What does this rule of integer calculations sound like ?

Thank you in advance for your answer.

 
wolf05632:

Hello! I've started to learn mquel4. I will use an example of a simple indicator that calculates max and min candle prices and draws lines at candle extremums through two buffers on the screen:

So, how to make the buffer line go through two (three, etc.) candlesticks instead of each one?


Use SetIndexShift();
 
MaxZ:

Then you have to use a zig-zag like indicator (My point of view):

I think you can figure out the changes. The only thing I was wrong about was to use the Bars parameter rather than IndicatorCounted() as the index of the bar to be calculated.

Your task now is to take the divider to an external parameter. It will be equal to the number of candlesticks that are passed.


Got it! It's elementary, you just have to approximate the "between-light values" for the buffer.

SZY: how to make the indicator work, i.e. make calculations (it WORKED, not was visible) only at a certain timeframe (Н1)?

 
Vinin:

Use SetIndexShift();

Thanks, but it won't work for me. I don't need an offset. Above I wrote. Suppose for the first candle buffer[1]=Hight[1], for the third buffer[3]=Hight[3], and for the second one I need to calculate: buffer[2]=MathAbs(Higth[1]-Hight[3])/2 and get what I wanted in the picture.
 
Roman.:

see here.
Thank you
 

Hello. Please tell me if there is a function for calculating the sum of a sequence of numbers.

My sequence has the form:

delta*(Lot+Lot*(X-1)), where X>or=0

Searched in a textbook, could not find it.

Thank you in advance.

 
double sum=Lot;
for(int i=1;i<X;i++)sum+=delta*(Lot+(Lot*(i-1));

 
Geowind64:

I apologize at once for my ignorance in mathematics :-)

Excerpt from the book: "When performing an assignment operation: first the type of expression A+Y will be converted to int (according to the rule of integer calculations) "

Question: How does this rule for calculating integers sound?

Thank you in advance for your answer.


IMHO, perhaps not the whole rule, but part of it is certain (in the context of your question): "As a result of calculating integers, namely their addition or subtraction, the result (their sum, in this case) will also be an integer."

So it is necessary and sufficient, in this case a variable sum of these integers A and Y, for example C, to define int type - interger - integers:

int A,Y,C;

С =  A + Y;

Read more here.

 
Roman.:

Guys, please advise, now by R.Vince I am looking for optimal f (for lot volume calculation) by geometric mean method.

The problem: I need to go through the orders history and with increment f = 0.01 from 0.01 to 1, find its optimal value where TWR is maximal

the bottom two formulas, and the value of the biggest loss on a trade is known to be D=-458:

which enumeration cycles, in particular to find the optimal f and where in the code, additionally, to organise.

Here is the starting code in int deinit() . It prints profit strategies in the tester correctly.


made a separate topic "calculating the Vince lot".

Then it will be easier to find if necessary

 
Vinin:


It would be in a separate topic and the name would be "Vince Lot Calculation".

Then it will be easier to find when needed


I see. I'll get it organized. I'm not used to creating new threads. :-)))

Oops. Thank you.