[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 293

 
is it worth trusting such modelling then??? and what are the other timeframes? I mean less or more than a minute?
 
Noterday писал(а) >>

How do I add up datetime variables? Suppose I write it like this:

In Metatrader, time is set in seconds. If you want to add an hour, it is 3600 seconds.

datetime NextOpenH1 = OpenH1 + 3600;

 

Help, knowledgeable people! I have decided to write an EA based on stochastic and zigzag. I am a dummy in programming, so a problem arose.


The first version of the EA worked correctly, but opened orders not always, even when the opening conditions were met.

The second version, which was written almost from scratch, does not open orders at all.

I have been struggling for a week, but cannot do anything.


i would like to try to find out what is wrong.

i attach the files.

Files:
exp.rar  6 kb
 

Good day, help please:

e-OpenByTime Expert Advisor, author: Kim Igor.

The Expert Advisor opens a position at the time set by the user (the TimeTrade parameter), could you add the TimeEndTrade parameter - close the open position at the specified time and add a comment on how to do this. I don't have enough knowledge of my own.

Thank you very much in advance ^_^

Files:
 
Noterday писал(а) >>

How do I add up datetime variables? Suppose I write it like this:

int OpenH1, NextOpenH1;
OpenH1= iTime(Symbol(),Period(),0);
NextOpenH1 = OpenH1 + 60*60;
I think it's possible to do something like this
 

Hello!

Problem: The indicator calculates some parameter in several ticks (at least, this is visible when observing it via Alert() ). It means that the first value of the parameter (and maybe the second one) is not correct.

Question: when the indicator is called using iCustom(), will the first parameter be visible/fetched or the set one?


Thanks in advance.
 
ikatsko писал(а) >>

Hello!

Problem: The indicator calculates some parameter in several ticks (at least, this is visible when observing it via Alert() ). That is, the first value of the parameter (and maybe the second one) is not correct.

Question: when I address the indicator via iCustom(), will the first parameter be visible, or the set one?

Thank you all in advance.

For all bars except zero, it will take the last calculated value that has already been set.

On zero, the last calculated one.

But it also depends on the logic of calculations in the indicator.

 
ikatsko писал(а) >>

Hello!

Problem: The indicator calculates some parameter in several ticks (at least, this is visible when observing it via Alert() ). It means that the first value of the parameter (and maybe the second one) is not correct.

Question: when the indicator is called through iCustom(), will the first parameter be visible, or the set one?

Thank you all in advance.

The first call of the indicator will perform the first calculation. If there are other calls of the same indicator during this call of the start function, the calculation will not be performed. The next calculation of this indicator will be performed only at the first call of this indicator on the next tick (at the next call of the start function)

 
Vinin >> :

.... previously calculated.

- The circulation is one-step, how is it "previously calculated"?

But it also depends on the logic of calculations in the indicator

- The logic is briefly as follows: optimize the number of bars to be analyzed. A chart is drawn on the specified number of bars. Then we look for the unacceptable episodes on the chart and change the number of bars to be analyzed accordingly. The task is complete if there are no such unacceptable episodes. Then the number of bars to be analyzed is fixed. Visually we can see that this process takes place over several bars.

 
ikatsko писал(а) >>

It would have been better to move the logic to the EA