Traiding on next candel

 

Hi

Need some help on coding a statement that will calculate all future statemenys based on the current candel close or the next candel open value - apposed to calulating values on a tic.

L

 

How much you willing to pay for info?
If you are cheap, learn to do your own homework.

At least trying doing your homework before asking......

 
wouldent ask if i new. been reading manuals for tha past fivve days. L
 

You are either a loser or a real stupid student.
Answers are everywhere.
PLEASE DO proper reading and proper searching first, okay???

 

I realize how the table can be twisted around.
Aand since I don't want to look arrogant, here is a tip for you.

I suggest you do proper reading on the "iopen()" and "iclose()" functions.

 
ckingher wrote >>

I realize how the table can be twisted around.
Aand since I don't want to look arrogant, here is a tip for you.

I suggest you do proper reading on the "iopen()" and "iclose()" functions.


Thanks for the vote of confidence..
 

Thanks for the vote of confidence... I must be a looser learning forex trading and EA coding.

All the scripts I write calculate their values on what looks like a tik count, irrespective of “period” statements in the indicators. The “if” statement will return multiple hits within one candle.

EMALongPrevious2=iMA(NULL,PERIOD_M15,PeriodLongEMA,0,MODE_EMA, PRICE_CLOSE, CurrentBar+TimeLag+1);

EMALongPrevious=iMA(NULL,PERIOD_M15,PeriodLongEMA,0,MODE_EMA, PRICE_CLOSE, CurrentBar+TimeLag);

if (EMAShortPrevious2<EMALongPrevious2 && EMAShortPrevious>EMALongPrevious)

PS. I must be a stupid student – your tip on iopen() did not help.

L

 

IClose() can be used to get the closing of a candle on a certain chart in a certain time frame within a certain index.
IOpen() can be used to get the opening of a new candle, blah, blah, blah......

 
Leftless:

Thanks for the vote of confidence... I must be a looser learning forex trading and EA coding.

All the scripts I write calculate their values on what looks like a tik count, irrespective of “period” statements in the indicators. The “if” statement will return multiple hits within one candle.

EMALongPrevious2=iMA(NULL,PERIOD_M15,PeriodLongEMA,0,MODE_EMA, PRICE_CLOSE, CurrentBar+TimeLag+1);

EMALongPrevious=iMA(NULL,PERIOD_M15,PeriodLongEMA,0,MODE_EMA, PRICE_CLOSE, CurrentBar+TimeLag);

if (EMAShortPrevious2<EMALongPrevious2 && EMAShortPrevious>EMALongPrevious)

PS. I must be a stupid student – your tip on iopen() did not help.

L

I'm new at this too, so there may well be a better way but if you add iVolume(NULL,0)==1 to your if statement, it will only execute on the first tick of the new bar and ignore subsequent ticks within the bar. Happy to here alternate methods from those more experienced.

 
Viffer wrote >>

I'm new at this too, so there may well be a better way but if you add iVolume(NULL,0)==1 to your if statement, it will only execute on the first tick of the new bar and ignore subsequent ticks within the bar. Happy to here alternate methods from those more experienced.


Thanks Viffer, works like a dream.

 

Leftless
Using Volume certainly works on backtesting and demo forward running but will not work reliably on live
See all of this thread for explanation https://www.mql5.com/en/forum/109887
-BB-