Ask! - page 19

 
Yannis:
witchazel,

I don't understand what do you mean with "will it give me the close of the last change?". Open/High/Low/Close concerns price bars. So yes, Close[1] will give you the close for previous bar on the time frame your chart is currently on. You can use iClose(NULL,0,Shift) (iOpen/iHigh/iLow) to get these values on time frame other than the one you're on. "0" stands for "current" time frame and "shift" for the bars back. Replace "0" with the time frame you need (1,5,15,30,60,240....) and shift with the number of bars back, you can even replace "NULL" to "GBPUSD" if your current chart is EURUSD but you need to address GBP previous close.

iClose(NULL,1,1) will give the close of your current pair, on 1 min chart, 1 bar back.

I would consider spending some time reading the threads addressing MT4 coding, i think CodesGuru has an excellent one for new coders, as well as Metaeditor help file and free experts and indicators posted allover the place.

Yannis

thanks i think i can do it now. what i am trying to do is open an order when the price crosses a custom indicator line. I am working on the daily chart but i want it to happen as soon as the price crossess the line. Seems like it should be easier then what i am doing, maybe i am taking the wrong approach.

thank you so much for all your help though, the mql language is easy but the functions are weird and some the ways they do stuff seem backwards hehe

 

Anyone, please help me to write this Metatrader 4 Program.

"Zhangge's Trend Double Principle"

Here is the basic rules

Looking to long,

1) A bullish candle "F" must close higher and at the same time break the long term(minimum 5 bars) resistance line as shown in figure 1 below

2) After candle "F" or at the same time, wait for a candle close above the openning price of previous 2 bearish candle. Like Figure 2.

3) If rule #2 fulfilled, then we go long at the close of that particular candle that has just fulfilled rule #2. like figure 3.

4) place a stop loss order at the lower end of the lowest bearish candle. As shown in Figure 3.

5) determine the height of "ab" as shown in figure 3.

6) place a limit order(to take profit) at the (entry price + height of "ab") marked "C" as shown in figure 4.

Looking to short,

ALL the mechanics and logic is just the inversed.

Thanks!!!

Files:
1.jpg  56 kb
2.jpg  62 kb
3.jpg  69 kb
4.jpg  67 kb
 

I want to play a different sound for an alert and I only see one sound available, I placed a playsound before my alert but it does not really work, besides that gives me 2 sounds, is there any way to play different sounds and still pop up an alert box?

 
Yannis:
witchazel,

I don't understand what do you mean with "will it give me the close of the last change?". Open/High/Low/Close concerns price bars. So yes, Close[1] will give you the close for previous bar on the time frame your chart is currently on. You can use iClose(NULL,0,Shift) (iOpen/iHigh/iLow) to get these values on time frame other than the one you're on. "0" stands for "current" time frame and "shift" for the bars back. Replace "0" with the time frame you need (1,5,15,30,60,240....) and shift with the number of bars back, you can even replace "NULL" to "GBPUSD" if your current chart is EURUSD but you need to address GBP previous close.

iClose(NULL,1,1) will give the close of your current pair, on 1 min chart, 1 bar back.

I would consider spending some time reading the threads addressing MT4 coding, i think CodesGuru has an excellent one for new coders, as well as Metaeditor help file and free experts and indicators posted allover the place.

Yannis

So yes, Close[1] will give you the close for previous bar on the time frame your chart is currently on.

I thing that we counting bars like that:

Open[0] = current

Open[1] = last

Open[2] = previous

Open[3] = third from current bar.

I'm right?

Bongo

 

Indicator into Expert

codersguru:
Hi folks,

I've got a lot of private messages asking me for helping with some pieces of code.

Here you can post your questions related to MQL4, and I'll do my best to answer them.

Hi

Can you guys go over how to make a indicator into a expert by embedding the code into the expert not iCustom or calls but as a function. For example Heiken ashi into the MACD Sample or your EMA Cross 2 or 3?

Thanks

Doc

 
dr_richard_gaines:
Hi

Can you guys go over how to make a indicator into a expert by embedding the code into the expert not iCustom or calls but as a function. For example Heiken ashi into the MACD Sample or your EMA Cross 2 or 3?

Thanks

Doc

There's an article about this here:

http://www.metatrader.info/node/137

 

Indicator into Experts

codersguru:
There's an article about this here: http://www.metatrader.info/node/137

Hi Codeguru,

Thank you very much for your most unselfish sharing of your great knowledge and abilities.

What about multiple indicators lets say

bollinger bands

keltner channels

bbsqueeze

heiken ashi

Thanking you in advance.

Dr Richard Gaines

 

Alerts

I have a ?. Is it possible to set up an alert(text message) for a simple crossing or color change like the chart below? If so, who can program this for me?

Files:
ff.gif  26 kb
 

alerts for indicators

summitfx:
I have a ?. Is it possible to set up an alert(text message) for a simple crossing or color change like the chart below? If so, who can program this for me?

Hi

Post the source code of the indicator and we will see. Is this lsma indicator ?

Doc

 

lsma

Yes, this is the lsam indicator!!

Reason: