EA question

 

I like to modify an EA

Currently I’m using the “present candle” and the “previous candle”

Originally I have this:

int start()

{

// M30

double ma_m30_white = iMA(Symbol(), PERIOD_M30, WhiteMA_M30_Period, WhiteMA_M30_Shift, WhiteMA_M30_Method, WhiteMA_M30_Price, 0);

double ma_m30_white_pre = iMA(Symbol(), PERIOD_M30, WhiteMA_M30_Period, WhiteMA_M30_Shift, WhiteMA_M30_Method, WhiteMA_M30_Price, 1);

Now I like to use the “previous previous candle” also

How can I modify? Like this?

double ma_m30_white_pre_pre = iMA(Symbol(), PERIOD_M30, WhiteMA_M30_Period, WhiteMA_M30_Shift, WhiteMA_M30_Method, WhiteMA_M30_Price, 2);

I added _pre and the end instead of 1 I wrote 2

What is the right way?

Second problem

I made sound file for different currency pair’s entry and exit.

How can I attach this file into the EA?

Thank you,

 

Code looks reasonable, although using the SRC button makes it look nicer, like this

double ma_m30_white_pre_pre = iMA(Symbol(), PERIOD_M30, WhiteMA_M30_Period, WhiteMA_M30_Shift, WhiteMA_M30_Method, WhiteMA_M30_Price, 2);

As for sounds (which I don't bother with, and so can't claim any skills with), it seems that you need .wav files, and place in the (MT4)\sounds\ folder
Check PlaySound("MySound.wav") under Common Functions to play it

If I'm wrong, I'm sure someone will correct me!

 
brewmanz:

Code looks reasonable, although using the SRC button makes it look nicer, like this

As for sounds (which I don't bother with, and so can't claim any skills with), it seems that you need .wav files, and place in the (MT4)\sounds\ folder
Check PlaySound("MySound.wav") under Common Functions to play it

If I'm wrong, I'm sure someone will correct me!

 
Thank you Thank you Thank you Brewmanz!
 

You're right Brewmanz.

[]'z
Niero

brewmanz:

Code looks reasonable, although using the SRC button makes it look nicer, like this

As for sounds (which I don't bother with, and so can't claim any skills with), it seems that you need .wav files, and place in the (MT4)\sounds\ folder
Check PlaySound("MySound.wav") under Common Functions to play it

If I'm wrong, I'm sure someone will correct me!

Reason: