MQL4 first step - page 3

 

The other question I have is can I output the values to a log file when my alert is triggered so I can try debug better?


If so where do I got o read up on how to do this?

Thanks kindly,


MW

 

Hello there,

It has been quite a while since my last visit to this site. It's been so long that I have forgotten my screen name and password so I had to create a new one. 

I've been fooling around with forex for a couple of years now, off and on. I would lose all of my money and say I was done, but the fact that I know I have the potential to do better keeps driving me back towards that  MT4 platform. So, with that being said, I'm back, and this time "Greed", being the key word here, is no longer a factor. No, I don't have $5000, or $10000 to start an account with, lol, so this should be interesting. As I grow into a famous trader, you all will be able to witness my progress first hand. That being said, it feels good to be back home. http://alpari.com/

Later.

 
MUZZLE_ZA:

The other question I have is can I output the values to a log file when my alert is triggered so I can try debug better?


If so where do I got o read up on how to do this?

Thanks kindly,


MW

You might be able to use the print functions listed on this page.
 

Thanks JD4,

Will research up on your suggestion.

I seem to have the EA working to some degree but the result of the trigger alert is not what I expected based on my rules so I need to see what the values were at the point in time when the alert was fired to validate the code logic.

If all is true then I need to re-think which price action values to use.

Enjoy your evening.


MW

 

Managed to get the FileWrite function working so now we wait for the file to be generated based on the alert.

I notice that when the EA is running in the expert window it is logging activity...Where can I read on the different states of each log?

Thanks,


MW

 
There is a trading history tab at the bottom of your trading terminal, some comments are put there as well, but I do not know specifically which ones are deemed worthy to go there.
 

Great thanks JD4...

The Profiler is interesting too...

It seems calling iCustom indicators query time is more intense than the in-built indicator functions...

 
MUZZLE_ZA:

Great thanks JD4...

The Profiler is interesting too...

It seems calling iCustom indicators query time is more intense than the in-built indicator functions...

That makes sense, because probably the stock ones are semi-already programmed in computer readable code and the new custom ones still need to get converted.
 

Yeah..Was good to actually see the results.

I have another question though.

If you take an indicator which represents a value between 0 and a 100 where the 0 is at the bottom of the indicator window eg.Stochastic divergence of 53.08641975

The value that is returned is this a number or a percentage. I guess my question really is if I write a rule that says StochsVal1 > StochsVal2 return true, do I need to transform the values before the below equation would be true?

StochsVal1 = Indicator output value of 53.08641975

StochsVal2 = Indicator output value of 46.09841


This is more of a sanity check in case there is something I'm not aware of?

p.s Trying to write business rules for the ASI indicator is 0.o !

 
MUZZLE_ZA:

Yeah..Was good to actually see the results.

I have another question though.

If you take an indicator which represents a value between 0 and a 100 where the 0 is at the bottom of the indicator window eg.Stochastic divergence of 53.08641975

The value that is returned is this a number or a percentage. I guess my question really is if I write a rule that says StochsVal1 > StochsVal2 return true, do I need to transform the values before the below equation would be true?

StochsVal1 = Indicator output value of 53.08641975

StochsVal2 = Indicator output value of 46.09841


This is more of a sanity check in case there is something I'm not aware of?

p.s Trying to write business rules for the ASI indicator is 0.o !

%K = 100[(C - L14)/(H14 - L14)]

C = the most recent closing price
L14 = the low of the 14 previous trading sessions
H14 = the highest price traded during the same 14-day period.

%D = 3-period moving average of %K



Read more: http://www.investopedia.com/terms/s/stochasticoscillator.asp#ixzz3gn0uB1Ex 
 

Reason: