[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 23

 
Sergey2011:

I don't understand how being in 15 minutes, through which time function, to organise a cycle of enumeration by day.

I hope the question is clear.

Thanks for the help


Look at the iBarShift help and/or you can work directly with the daily bars like this: iOpen(Symbol(),PERIOD_D1,1) - previous day's opening, etc.
 
Ereke:
Another Smartypants !
You have no idea how right you are in your characterisation of this forum! I hope that you will also draw the right conclusions about yourself and the quality of your enquiries, since you have come into such an environment.
 
granit77:
You have no idea how right you are in your characterisation of this forum! I hope that you will also draw the right conclusions about yourself and the quality of your enquiries, since you have come into such an environment.
+10 :)
 
granit77:
You have no idea how right you are in your characterisation of this forum! I hope that you will also draw the right conclusions about yourself and the quality of your enquiries, since you have come into such an environment.

artmedia70

THANK YOU !..................... I have already been helped !

 
artmedia70: Victor said it right - a shot in the air...
It reminds me of an anecdote...
Two Chukchi are lost in the woods...
-Shoot in the air, maybe someone will hear and help...
A few minutes later...
-Shoot some more.
-I can't, I'm out of arrows...
 
volshebnik:
The closing price can be well above the fractal (if the fractal is up) and then the potential profit is lost. I check the price breakout on every tick.


I agree, you can do that, as buy order opens on ask, you can compare it with ask...

if (Ask > upfractal) { DO IT }

To the question - why are not all your entry conditions triggered, I'll explain again in detail - it's because of incorrect fractal calculation...

To correctly calculate the value of the last fractal, you should use this construction using an auxiliary variable...

 fractal_h = iFractals(Symbol(),PERIOD_H1, MODE_UPPER, 3);
   if(fractal_h!=0)  upfractal=iFractals(Symbol(), PERIOD_H1, MODE_UPPER, 3); 
   
   fractal_l = iFractals(Symbol(), PERIOD_H1, MODE_LOWER, 3);
   if(fractal_l!=0)  dwfractal=iFractals(Symbol(),PERIOD_H1, MODE_LOWER, 3); 

In your code, it's not there and the fractal has appeared, yes, you have memorized its value well. You wrote it correctly - not on the 3rd bar, but on the 2nd one, when we know its value on the 0th bar already, what happens next ... If the price does not break through the value of the latest fractal on the next bar, and, for example, "small steps", on each subsequent bar moves to its penetration without forming a regular fractal (which usually happens), then your situation is ... your calculated fractal value is reset to "0" by itself... and there is no need to zero it additionally as you do in your code (I won't cite where you know)... And that is why upfractal !=0 appears only on the next bar after the calculated one (where the latest fractal was)...

That's why they remember and keep the value of the newest fractal when forming subsequent bars just by entering an auxiliary variable, try to make these changes in your code and see that the deals are done right at the breakthrough of the latest fractal and it makes no difference how many bars later this breakthrough occurs, if you still do not understand, enter the print instead of your alert and look how the upfractal variable changes with each new bar and you will understand everything - it resets itself to "0" at the new formed bar, and the fractal is broken through, say, at the 8th bar - that's all, its value has been equal to zero for a long time.

That's how it is with you:


  
            
                upfractal=iFractals(Symbol(), PERIOD, MODE_UPPER, 3);
                Alert("upfractal вначале = ",upfractal);
if (Двверх==true && upfractal !=0 && Bid > NormalizeDouble(upfractal+1*Point,Digits) && Tвверх!=Time[0] && Сделкавверх==false) // Условие открытия ордера при пробитии фрактала вверх

That's how it should be:

 fractal_h = iFractals(Symbol(),PERIOD_H1, MODE_UPPER, 3);
   if(fractal_h!=0)  upfractal=iFractals(Symbol(), PERIOD_H1, MODE_UPPER, 3);
 if (Двверх==true && Ask > NormalizeDouble(upfractal+1*Point,Digits) && Tвверх!=Time[0] && Сделкавверх==false) 
   

"Roman, why? Isn't it the same thing? For example, if MA_8<MA_2 is the same as (MA_8-MA_2)<0 ?"

It's the same, but for real-world operation and 100-guess reliability, for no ground for possible "glitches" - the 2nd option is needed.

P.S. Instead of alerts, use prints and track the resulting variable values over time in the tester in the EA log to analyse the "correct" operation of your owl.

 
Roman.:


I agree, you can do that, as the buy order opens on the ask, you can compare with the ask...

if (Ask > upfractal) { DO IT }

Visually, I analyse the chart for penetration of a fractal and search for dependencies by the visible price, i.e. the bid. That is why I consider a fractal break as a bid (and upfractal also gives a bid, not an ask).
 
Example:
  datetime some_time=D'2004.03.21 12:00'; int shift=iBarShift("EUROUSD",PERIOD_M1,some_time); Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift);

I've looked through the help, I don't understand (I don't get it) how to specify in the variable "some_time" in 15 minutes, that I need the previous day, i.e. if today is Jan. 25. 2011 how can I set January 24, 23, 22, etc. to search.

Thanks if you can explain.

 
volshebnik:
I visually analyse the chart for penetration of a fractal and search for dependencies by the visible price, i.e. the bid. That's why I consider a fractal break as a bid (and upfractal also gives a bid, not an ask).


you can do it that way too, it is not important :-)))

Have you figured it out now?

 
Roman.:


I agree, you can do it that way, as the buy order opens on the ask, you can compare it with the ask...

To the question of why you don't have all entry conditions triggered, I'll explain again in detail - it's because the fractal is not calculated correctly...

For correct calculation of value of the last fractal it is necessary to use such construction with use of auxiliary variable...

In your code, it's not there and the fractal has appeared, yes, you memorized its value well. You wrote it correctly - not on the 3rd bar, but on the 2nd one, when we know its value on the 0th bar, what happens next ... If the price does not break through the value of the latest fractal on the next bar, and, for example, "small steps", on each subsequent bar moves to its penetration without forming a regular fractal (which usually happens), then your situation is ... your calculated fractal value is reset to "0" by itself... and there is no need to zero it additionally as you do in your code (I won't cite where you know)... And that is why upfractal !=0 only on the next bar after the calculated one (where the latest fractal was).

The order is opened by asc, then it can be compared to asc. That's why they remember and keep the value of the latest fractal when subsequent bars are formed just by entering an auxiliary variable, try to correct these changes in your code and see that the deals are done just at the breakthrough of the latest fractal and it doesn't matter how many bars later this breakthrough occurs,

Yes, Roman, thank you very much. I added an auxiliary parameter for fractal definition, now all trades open.
Reason: