Ask! - page 95

 

The short answer is No.

As always, bar 0 is temporally incomplete for both EAs and indicators, and its high, low, close and volume are almost certainly different from how they end up when that bar completes and becomes bar 1. More exactly, the value of StochRSICurr at the end of the daily bar is only known at the first tick of the next daily bar (and later). I think you do yourself a disservice trying to use bar 0 values, since these, with few exceptions, only reflect the partial state of the incomplete bar.

As far as I know, the indicator gets invoked at the time of the first iCustom call with the particular parameter value combination, during each EA start() function invocation. Successive iCustom calls during the one EA start function call, to the same indicator, with the same parameter value configuration, reuses whatever the first call produced. The next EA start() function, again calling iCustom, will again invoke the indicator, in the context of the tick that caused the start function to be invoked.

Thus, in the eyes of the indicator, it gets invoked once for each tick that the EA lets it get invoked for. By telling an MA to use open price or high price etc only changes which bar values it looks at, while the manner of invocation will remain the same: it is invoked at every tick (that the EA lets it).

 
 

Please help me

Hi all,

Nobody want to help me. I post one more time my problem and please help me.

I just want understand why the result is not the with the two ways of coding the same indicator (see the code and picture).

Manuel

Files:
 

slow backtesting

Just wanted to say thanks Ralph Ronnquist. I now have that part functioning properly.

I do have another question for anybody who can help. When I try to use Strategy Tester with my EA, it is extremely slow. I know it works as i do get some results but I need to leave it on overnight to get 3 month's of results.

My EA is based on daily trend using Stochastic RSI crossing (testing) and then only price action. What could be the main reasons of it being so slow. Is it in the programming or is it because I'm calling an outside indicator or is it that Stochastic RSI swallows a lot of power.

I run many other EA's and they are all a lot faster than mine. My system is plenty powerful with 3GB of Ram and Intel Centrino Duo processor.

Any suggestions of ideas would be appreciated.

Putz

 

How to write

Hi Coders

i'm totally newbie in Mql.4 coding. Still learning by modified existing EAs.

Following example for a floating Pivot:

for current Bar;

double Flow_Pivot0 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)

+ iClose(NULL,0,0))/3.0;

for one bar back

where i must set "number" or Variable "shift_bars"

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)

+ iClose(NULL,TimeFrame_Flow,0))/3.0;

Thanks a lot

 
 

No Solution found

Hi Bongo

sorry but on this link i don't found an answer.

Normal case

double High1 = iHigh(NULL,0,0); // Price high now

when i need for extern input

double iHigh1 = iHigh(NULL,iHigh12_TimeFrame,Barsback_iHigh1); // Price high now

Greenmeans how many bars back

but in my case, wherei must insert Barback_xxx, the full line below must be one bar back

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)

+ iClose(NULL,TimeFrame_Flow,0))/3.0;

Bongo:
BadGay,

go to:

https://www.mql5.com/en/forum/173124

B.
 

Back Times

Badguy:
Hi Bongo

sorry but on this link i don't found an answer.

Normal case

double High1 = iHigh(NULL,0,0); // Price high now

when i need for extern input

double iHigh1 = iHigh(NULL,iHigh12_TimeFrame,Barsback_iHigh1); // Price high now

Greenmeans how many bars back

but in my case, wherei must insert Barback_xxx, the full line below must be one bar back

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)

+ iClose(NULL,TimeFrame_Flow,0))/3.0;

Hi

If you want to shift the line back by 1 bar at a time.

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)

+ iClose(NULL,TimeFrame_Flow,0))/3.0; = Current Day

double Flow_Pivot1 = (iHigh(NULL,1440,1)+iLow(NULL,1440,1)

+ iClose(NULL,TimeFrame_Flow,1))/3.0; = Back 1 day

double Flow_Pivot1 = (iHigh(NULL,1440,2)+iLow(NULL,1440,2)

+ iClose(NULL,TimeFrame_Flow,2))/3.0; = Back 2 Days

double Flow_Pivot1 = (iHigh(NULL,1440,Barback_xxx)+iLow(NULL,1440,Barback_xxx)

+ iClose(NULL,TimeFrame_Flow,Barback_xxx))/3.0;

Barback_xxx = 1 ,2, 3, 4 etc will shift back 1 bar at a time.

 

Hi Cja

its not what i mean

cja:
Hi

If you want to shift the line back by 1 bar at a time.

Thats floating PIVOT. Right?

#1

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)

+ iClose(NULL,TimeFrame_Flow,0))/3.0; = Current Day

That's normal PIVOT for today. Right??

#2

double Flow_Pivot1 = (iHigh(NULL,1440,1)+iLow(NULL,1440,1)

+ iClose(NULL,TimeFrame_Flow,1))/3.0; = Back 1 day

That's normal PIVOT but from yesterday. Right??

#3

double Flow_Pivot1 = (iHigh(NULL,1440,2)+iLow(NULL,1440,2)

+ iClose(NULL,TimeFrame_Flow,2))/3.0; = Back 2 Days

I need #1, but xx bars back in any Timeframe.

Same function how this Indi : PrevDayAndFloatingPivot_O.mq4. ( but only the FloatingPivot )

Indi is attached

double Flow_Pivot1 = (iHigh(NULL,1440,Barback_xxx)+iLow(NULL,1440,Barback_xxx)

+ iClose(NULL,TimeFrame_Flow,Barback_xxx))/3.0;

Barback_xxx = 1 ,2, 3, 4 etc will shift back 1 bar at a time.
 

maybe this is a silly question... but i hope u'll help me.

.... how to close or open an order (pending order) when another order reach tp?

thanks b4 !

Reason: