MQL4 Learning - page 93

 

.tpl contents

Does anyone know where I can find a breakdown of what each of the variables are in this file? I'm specifically interested in the following:

leftpos=398

scale=8

graph=0

fore=0

grid=1

scroll=1

shift=0

ohlc=1

shift_size=20

fixed_pos=0

window_left=0

window_top=0

window_right=786

window_bottom=350

window_type=3

height=100

Everything else in there is pretty self explanitory(sp).

IF they're what I think they are, my problem may already be solved for me.

 
codersguru:
Test the attached script.

Thanks Codersguru... i trying the code that you suggested, but I have a question: is it possible to reconstruct the window of the alarms complete of mt4 ? There is a specific istruction?

thanks

 

MQL4 language

Hello,

I'm looking for someone who knows how to program with MQL4 language and has good knowledge in the Forex market. I have some ideas for strategies that i'm willing to share and i would reword who may put them on an EA.

I'm not sure this is the right place to look for...

Thanks anyway,

Dror

 

Would anyone be willing to help write some alerts (at no cost) for two trading systems I use? They have proven to be good systems, but I miss a lot of the entries because I am not watching the chart at the moments they appear. Alerts would help greatly with this.

If someone is willing to help, please send me a private message or e-mail to himezelda1@aim.com so we can discuss it.

 

NQ4 function to apply a template to a chart

Hi Guys,

Is there a MQ4 function that will apply a specific template to the current chart?

The reason I am asking is that if it is possible I want to be able to write a script to run through all open charts and change the template. I know I can use profiles but looking at 15 pairs with 3 templates and 4 time frames is alot of mucking around. If I could just run a script to do this that would be fantastic.

Regards

Steve

 

Save log file from COMMENT()

Good day traders/programmers:

I'm new to learning MQ4 and have a question for any seasoned expert out there:

How can I make it so that the comment() displayed on the chart from an EA are saved onto a file. Preferably an excel file but a text will also do.

--------------

If someone with experience can help a novice write a code to have a counter every 1 minute to print time and the value of the counter.

ie

A = A +1 //every minute

print a text file to show:

12:01 A = 1

12:02 A = 2

etc

------------

I find that I can learn better by dissecting simple things like this.

Much appreciated.

Kasio

 

Smoothing values with something better then EMA

Alright so what i want to do is smooth an array/buffer of values with a method of choice, just as in this example except use a custom indicator.

for(int i=0; i<limit; i++)

{

Buf1=iRSI(NULL,0,period_RSI,applied_price_RSI,i);

}

for(i=0; i<limit; i++)

{

Buf0 = iMAOnArray(Buf1,0,period_MA,0,ma_method,i) ;

}

So for an example, lets say i want to smooth the rsi values with a jurik moving average, or a hull moving average, would i have to include the code of these averages in the indicator or is there an easier way like above.

Examples of indicators that implement this would be most helpful.

Im also looking for something with less lag then EMA, would DECEMA be a good choice?

(And no im not just going to smooth rsi values i know of many indicators that do that im looking for a simple way to apply custom smoothing)

 

Re-initialising indicators via ea

Hi all - it there a way to re-initialise an indicator via an ea? Or possibly unload and then reload an indicator via an ea?

 

Important queries about MQL4

Hi!

I am new to MQL4, however I have experience in programming languages. I have the following queries as far as MQL is concerned:

1) I understand the whole code in an EA repeats itself unlimitedly. Is it right?

2) Given the above hypothesis how may I transform in code this one: I want the robot during any M15 bar to open 2 trades maximum. How may I limit the robot from opening more trades during this certain interval since the code will be repeated again and again?

3)How is it possible to backtest a robot which opens simultaneously trades in more than one currency pair? If choosing one pair the backtest trades this pair; however the robot is functioning by examining all the trades as a whole

Thank you very very much for the future asnwers

 

To answer you questions:

1: The start function is called on every tick. It's the only function that is automatically called. After that the functions/methods that get called is a result of your coding logic.

2: As mentioned above you'd code logic to avoid this happening. In your example you'd simply count the number of orders for this period open and closed and if it were two you'd skip opening more.

3: It's not possible to accurately back test two different currency pairs in MT4 backtester. Best way is to forward test on a demo. Another thing you could do is write an EA that would open the .hst files for both pairs and run a test on this. This would not use backtester at all. It's a bit overkill but it depends on your needs.

Lux