[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 235

 
Can you please advise whether it is possible to open a position manually in the Metatrader4 Strategy Tester instead of using an Expert Advisor? In order not to calculate pips in a calculator, but to press the button, an order opening window will appear, fill the data and press F12 and the tester itself will calculate as when opening by an EA. Probably, there is a ready-made programme for this purpose, I have not found it in my search.
 
Good day everyone. I have a question here, several questions to be exact, help me out.
1: If I have a level, and if the price is equal to this level then open an order. The question is if the price can skip this level, fly through it quickly and not be equal to the level which I have or if I have a GAP, an order will be opened where it should be, ie at the level?
2: I got errors in the log, I want to know what they mean. [B]1-Signal-failed parse signals,[/B] [B]2-DataCenter connecting failed [2] and [6][/B] 3-(I do not remember exactly but it says complete disabled when modifying the order)? Please advise what to do in those or other cases, thanks so much again!
 
TarasBY:

To understand what's going on, you need to output the calculations to the printer:

and analyze the results.

I REALIZED I MUST HAVE MISUNDERSTOOD SOMETHING.

How I imagined the execution of the condition in the if header

-program gets value of Bid variable (0.86084)

-drops the value of variable Bid (0.86084) to variable massiv[S] (0.85375)

-maps the obtained difference 0.00709 to the constant 0

-if the difference is > 0, control in the if statement body is not given and the order is not opened

-If the difference <= 0, control is delivered to the if statement body and the order is opened

As I imagined the execution of function ArrayBsearch( massiv, value,WHOLE_ARRAY, 0, MODE_ASCEND)

TIP: Returns the index of the first found element in the first array dimension.

If there is no element with the specified value in the array, the function will return the index of the closest by value element, between which the sought value is located.

-the function gets the value equal to the price of the last tick (Bid-0.86084)

-the function goes through the array values from the lesser to the greater - it doesn't find the full match between any value of the array and the value value

- as there is no value 0.86084 in the array, the function returns the closest smallervalue of the array. i.e. 0 .820864(first),0.81074,0.85375,0.80084,0.81084,0.86088(last) i.e. 0.85375 is the closest value to 0.86084 the smaller value. Between 0.85375 and 0.86088 is the value you are looking for=0.86084

=====================================================================================================

Theparameters in your function print besides value of element massiv[S] are: massiv[S-1] and massiv[S+1]. From value of massiv[S]( 0.85375) you first subtract 1, and then add 1.

I haven't read about if in header (or in ArrayBsearch()) from arrayiv[S] value firstly 1 is subtracted and then 1 is added.

I would appreciate it if you could explain this point to me or give me a link.

Thank you.


 
solnce600:

Thefunction print has anotherparameters - massiv[S-1] and massiv[S+1]. You want to subtract 1 from massiv[S]( 0.85375) value and add 1 after it.

I haven't read about if header (or ArrayBsearch() ) first subtract 1 from massiv[S] value and then add 1 to it in any MQL textbook.

I would appreciate it if you could explain this point to me or give me a link.

Thank you.

You will apply your reasoning after you have made the print. Have you made the print (you don't need to change anything in it)? - Show me what's in it.
 

Print in this link.

http://clip2net.com/s/4MRjJe

 

I noticed that

- the value of massiv[0](probably [S]) is the first value of the array to begin with

- value of massiv[1](probably [S+1] ) is the second value of the array, i.e., it follows the value from which the array begins

-These values are repeated every time PRINT is encountered.

=============================================

- in the year 2000, the price value was 4 more digits after the dot.

- in the tester on the chart - 5 digits

-in the tester in the result - 5 signs

-in the tester in the log in the printer - 4 characters

And I have 5 digits in the array.

QUESTION - How many digits does the software read?

 

You don't see anything there???

I see that ArrayBsearch() returns 0 (as an element index) EVERYWHERE. In the 0th cell of your array is the number 1.0408. Let's go back to the code:

if( (NormalizeDouble (Bid-massiv[S],Digits) <=0))

Now substitute the obtained variable values in this condition (on the carite Bid is in the range 0.8-0.9, let's take the maximum of this range - 0.9): if (0.9000 - 1.0408 <= 0) OrderSend(). The condition is fulfilled RIGHT!!! Look for errors in completing your array. You presumably did not pay attention to this clause in the ArrayBsearch() function:

Note: Binary search only handles sorted arrays. The ArraySort() function is used to sort a numeric array.

P.S. Print should preferably be provided not as picture, but by simultaneous selection of several lines (using SHIFT - if you don't know how to do it) of this very print (10-20 lines is enough) in terminal window, then copy and paste selected lines in your post as code using SRC button.

P.P.S. I just noticed the obvious syntax error - this line should be placed outside (before) the start() function:

#include <MASSIV.mqh> 
 
solnce600:

I noticed that

-in the tester in the log in the printer- 4 characters

Read documentation https://docs.mql4.com/ru/common/print

void Print( ...)
Prints some message to the Expert log. Parameters can be of any type. The number of parameters can not exceed 64.

Arrays cannot be passed to Print(). Arrays must be printed element by element.

Data of the double type is printed with 4 decimal digits after the point. To get more accuracy, the DoubleToStr() function should be used.
 
TarasBY:

You didn't see anything there???

I see that ArrayBsearch() returns 0 (as an element index) EVERYWHERE. In the 0th cell of your array is the number 1.0408. Back to the code:

Now we substitute the obtained variable values into this condition (Bid on the carotine is in the range of 0.8-0.9, let's take the maximum of this range - 0.9): if (0.9000 - 1.0408 <= 0) OrderSend(). The condition is fulfilled RIGHT!!! Look for errors in completing your array. You presumably did not pay attention to this clause in the ArrayBsearch() function:

Note: Binary search only handles sorted arrays. The ArraySort() function is used to sort a numeric array.

I'm not quite sure what binary search means. Is it a search in a two-dimensional array? But I have a one-dimensional one.
 
how to adjust the Fibonacci period in mt 4 200 144 89 55 34