How to detect Heiken Ashi Body close above/below MA? - page 2

 
double OPEN=iCustom(NULL,0,"Heiken Ashi",Red,White,Red,White,2,1);      //1.1332363675022248
double CLOSE=iCustom(NULL,0,"Heiken Ashi",Red,White,Red,White,3,1;      // 1.1329975000000001
double H1EMAprev = NormalizeDouble ( iMA ( NULL , PERIOD_H1 , 14 , 0 , MODE_EMA , PRICE_CLOSE , 1 ), Digits());         // 1.13392


I am getting values mentioned in comments from the above code. How could I verify that I am getting perfect values? Please review attached picture let me know how could I verify my values getting from my code?

How to verify values of HA getting from my code?

 
Keith Watford:

[in]  Line index. Can be from 0 to 7 and must correspond with the index, specified in call of the SetIndexBuffer() function.

According to documentation. I can use only 0 till 7 values 0 is for current candle and 7 is for 7th last candle and what if I want to access info older then 7th last candle?

Line index can be much higher than 7 nowadays, documentation has not been updated.

Line index has nothing to do with candles. It is the buffer used in the indicator - Marco has already told you this.


for HAOpen I have to use 2?

for HALowI have to use 3?

and what if I want to HAHigh, HAClose?

Write a simple indicator, get the values and find out.

Put some effort in yourself. You will never learn anything if you don't study and try things.

For writing a simple indicator I don't have knowledge of HA could u refer me any tutorial for understanding HA? so i can clear my concepts.

 
Keith Watford:

[in]  Line index. Can be from 0 to 7 and must correspond with the index, specified in call of the SetIndexBuffer() function.

According to documentation. I can use only 0 till 7 values 0 is for current candle and 7 is for 7th last candle and what if I want to access info older then 7th last candle?

Line index can be much higher than 7 nowadays, documentation has not been updated.

Line index has nothing to do with candles. It is the buffer used in the indicator - Marco has already told you this.


for HAOpen I have to use 2?

for HALowI have to use 3?

and what if I want to HAHigh, HAClose?

Write a simple indicator, get the values and find out.

Put some effort in yourself. You will never learn anything if you don't study and try things.

In the HA code I found this code:

SetIndexLabel(0,"Low/High");
SetIndexLabel(1,"High/Low");
SetIndexLabel(2,"Open");
SetIndexLabel(3,"Close");

Please confirm that if I want:

Mode NameMode
Low/High0
High/Low1
Open2
Close3

to access info of close then I have to place 3 in mode value 2 for open value.

Does I got correctly?

Also please explain the difference between Low/High & High/Low?

 

I am getting values mentioned in comments from the above code. How could I verify that I am getting perfect values? Please review attached picture let me know how could I verify my values getting from my code?

Open the data window (CTRL +D)

and you can check the values by hovering the mouse over the relevant candle


 
kumaillakhani:

For writing a simple indicator I don't have knowledge of HA could u refer me any tutorial for understanding HA? so i can clear my concepts.

HA is not a simple one to understand for a beginner. I have to re-aquaint myself with it everytime I use it.

I don't know of any tutorial

 

In the HA code I found this code:

SetIndexLabel(0,"Low/High");
SetIndexLabel(1,"High/Low");
SetIndexLabel(2,"Open");
SetIndexLabel(3,"Close");

It can be difficult to understand with histograms because when they are in pairs, the colour depends on which is the greater.

 
Keith Watford:

HA is not a simple one to understand for a beginner. I have to re-aquaint myself with it everytime I use it.

I don't know of any tutorial

I am not new in programming but I am very newbie in MQL4 programming could you suggest me a good tutorial for referencing.

 
kumaillakhani:

I am not new in programming but I am very newbie in MQL4 programming could you suggest me a good tutorial for referencing.

I don't know of any up to date decent tutorial. "The" Book used to be useful but it doesn't include a lot of new functions. ( I say new but they have been around over 4 years now, I think)

 
Keith Watford:

I don't know of any up to date decent tutorial. "The" Book used to be useful but it doesn't include a lot of new functions. ( I say new but they have been around over 4 years now, I think)

Okay

 

I want help actually I want my EA to place a pending buy order when Last HA candle's body closes above MA and in H4 chart it is also indicating same trend and for sell pending order I want opposite criteria.

I have already worked on this with normal close but I want this to be worked with HA body close instead of normal close. Can anyone help how can I achieve this approach?

Reason: