Market Prediction with EMA CROSS 1/2 - page 2

 

Warning, before using this indicator!

hi, I just noticed the indicator EMA_Prediction.mq4 contains a serious bug.

I spent all day yesterday marking my nice chart with vertical lines so that I would know when something important occured.

I put this indicator on and then took it off the chart... bad idea... all my lines are gone... I know it's my fault for not looking at the code before running but just in case there are some others who don't proof-read before running, I thought I'd give you the heads up.

So just to recap... EMA_Prediction.mq4 will delete all your Vertical Lines on the chart when you remove it or whenever else metatrader calls the deinit() function

my suggestion to the author would be to incorporate code similar to this:

// will delete all objects that contain aID_Prefix

void deleteObjects(string aID_Prefix) {

int nObjects = ObjectsTotal();

for (int i=nObjects; i>=0; i--) {

string objName = ObjectName(i);

if(StringFind(objName, aID_Prefix, 0) >= 0)

ObjectDelete(objName);

}

}

and to give his vlines all the same prefix that wouldn't conflict with those of another script... e.g. "EMA_PREDICTION_VLINE_"

[DISCLAIMER: use this code at your own risk. I am not responsible for any code I create. However, it seems to work for me so far just fine. Just be aware if you are too lenient with the aID_Prefix it will delete alot of objects... e.g. aIDPrefix="a" would delete all those CONTAINING "a". If you want to only delete those starting with "a" then I would suggest changing the StringFind's >=0 to just 0. Although I have not tested that modification, it should work]

 
ShadowWz:
Hi,

i looke in the code and i see:

"iMA(NULL,0,LongEma,0,MODE_EMA, PRICE_CLOSE, pos-1)"

now my question is how can you get "pos-1" for current,or even previous, day ?

* i wish i wrong and this indicator will predict the direction of EMA.

Cheers.

CodersGuru,

Could you please address this? I think Shadow is correct. At first I thought that maybe it had something to do with your loop counting Down To 0 instead of Up From 0, but either way, I believe it should still be +1. (Been trying for an hour to get my head around this) Also, you seem to use "pos-1" to position the arrows Forward 1 bar, so I'm not sure how "pos-1" can also be used to reference the Previous bar in the MA.

If the PreviousEMA calculations are truly supposed to be "pos+1", then the 2 IF statements used to generate the signals can never be true.

I know I'm nowhere near the coder you are, so please correct me if I/we are wrong. Also, if your code is correct, could you please try to explain why/how it works as I don't understand.

Thanks,

Keris

 

Thanks Codersguru

Perhaps SL for buy

- reversal signal

- current low below last low

- close below halft of last candlestick

For sell inverted

 

Market Prediction

Hi Coders

Thanks for this indicator (and all your other work). Can we manually backtest this? ie are the signals stable or will they change if we look back in time?

Thanks Mike.

 

OK, today we have two signal arrows, one is aussie the other one is GBPCHF. Let's see to it till the end of the day.

Files:
aussie.gif  19 kb
gbpchf.gif  16 kb
 

I can't get this indicator to NOT show vertical lines.

Anyone else have this problem?

Looks interesting...

 

Please do not use this indicator with a real account until CodersGuru (or some other knowledgeable coder) responds to my post above. I still do not believe it is calculating things properly. See post #13 above.

Keris

Note: If it turns out that the indicator does calculate properly, I'll delete my posts so as to not clutter up the thread.

 

Hi

Bad news

Look at pic. one is bevore and second after change of TF. Arrow have changed .

Files:
bez_nazwy.gif  16 kb
bez_nazwy2.gif  16 kb
 

Robak , i don't see anything wrong , also don't forget that you are using 1 hour TF, i believe it is too short , you 'll have choppy and wimpy market.

I am using H4 and D1

 

until now GBPCHF still goes south, however AUDUSD has lost its arrow.

I tend to think this trivial cross of EMA1 (=price) with EMA2 doesn't predict anything since it's impossible to formulate the cross correctly.

I wish I am wrong

Files:
aussie2.gif  14 kb
gbpchf2.gif  16 kb