Connect an Automated Fib to a Zig Zag indicator

 

Hi,

Can someone please help me figure this out. I am new to programming (three day C++ training behind me) and lack the skills and knowledge to figure this out. I have been looking at this code for four days and found where the Fibo is and to make changes to the Zig Zag indicator, but I have no idea how to do the following;

1: I want to change the color of the Fibonacci lines to Aqua

2: For an up trend: I want to attach the Fibonacci to the current low and the previous high. For a down trend: I need the Fibonacci to connect to the current high and the previous low.

eg: This is my current Fibonacci setup - File: Fibo current

This is how I want it to look - File: Fibo desired

I have attached the code for the indicator.

I think I need to add something to the OBJ_FIBO, but not sure what.

Any advise will be greatly appreciated.

Thanks

 

I was correct thinking that it has something to do with the OBJ_FIBO line.

ObjectCreate("Fibonacci Lines", OBJ_FIBO, 0, Time[PreviousZigZag], ExtMapBuffer[LastZigZag], Time[LastZigZag], ExtMapBuffer[PreviousZigZag]);

color levelColor = Aqua;

and also

ObjectSet("Fibonacci Lines",OBJPROP_LEVELCOLOR,levelColor);

I added the code for the color and also the $% per Fib line, so it's going great. Now I will need to figure out how to move the Fib lines to where I want them.

 

No better teacher than trial and error.

I figured it out and now the indicator is working like a charm.

 

Yes, i find it will interesting to detect the market diverangence. and i try to download the mq4 file, and how to use it? can you please explains it? 

Thank you.

 
dnlrsms0:

I was correct thinking that it has something to do with the OBJ_FIBO line.

ObjectCreate("Fibonacci Lines", OBJ_FIBO, 0, Time[PreviousZigZag], ExtMapBuffer[LastZigZag], Time[LastZigZag], ExtMapBuffer[PreviousZigZag]);

color levelColor = Aqua;

and also

ObjectSet("Fibonacci Lines",OBJPROP_LEVELCOLOR,levelColor);

I added the code for the color and also the $% per Fib line, so it's going great. Now I will need to figure out how to move the Fib lines to where I want them.

Now I will need to figure out how to move the Fib lines to where I want them.

<<use the same function:

ObjectSet("Fibonacci Lines",OBJPROP_ANCHOR,...);

or some thing else. search the manual for ObjectSet and try it for your self

here is some parts of them:



Object value index used with ObjectGet() and ObjectSet() functions. It can be any of the following values:

ID

Value

Type

Description

OBJPROP_TIME1

0

datetime

Datetime value to set/get first coordinate time part

OBJPROP_PRICE1

1

double

Double value to set/get first coordinate price part

OBJPROP_TIME2

2

datetime

Datetime value to set/get second coordinate time part

OBJPROP_PRICE2

3

double

Double value to set/get second coordinate price part

OBJPROP_TIME3

4

datetime

Datetime value to set/get third coordinate time part

OBJPROP_PRICE3

5

double

Double value to set/get third coordinate price part

OBJPROP_ANCHOR

Location of the anchor point of a graphical object

ENUM_ARROW_ANCHOR (for OBJ_ARROW),

ENUM_ANCHOR_POINT (for OBJ_LABEL, OBJ_BITMAP_LABEL and OBJ_TEXT)

Reason: