Jump to content

Interesting Fib indicator


4xmeter

Recommended Posts

:?: No Please! Just play with it and let me know!

 

 

#property link      "Modified by cja"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Black
#property indicator_color2 Black
#property indicator_color3 Black

extern int TimeFrame = 60;
extern int Fibo_Num = 12345;
extern color Intra_color = RoyalBlue;
extern color Upper_color = Blue;
extern color Lower_color = DodgerBlue;
double g_price_96;
double g_price_104;
double gd_112;
int g_datetime_120;

int init() {
  return (0);
}

int deinit() {
  ObjectDelete("LongFibo" + Fibo_Num + "");
  ObjectDelete("ShortFibo" + Fibo_Num + "");
  ObjectDelete("IntradayFibo" + Fibo_Num + "");
  ObjectDelete("Fibo" + Fibo_Num + "");
  ObjectDelete("Fibo1" + Fibo_Num + "");
  return (0);
}

int DrawFibo() {
  string ls_0 = "";
  string ls_8 = "";
  if (TimeFrame == PERIOD_M1) return (-1);
  if (TimeFrame == PERIOD_M5) return (-1);
  if (TimeFrame == PERIOD_M15) return (-1);
  if (TimeFrame == PERIOD_M30) return (-1);
  if (TimeFrame == PERIOD_H1) ls_0 = "H1";
  if (TimeFrame == PERIOD_H4) ls_0 = "H4";
  if (TimeFrame == PERIOD_D1) ls_0 = "Daily";
  if (TimeFrame == PERIOD_W1) ls_0 = "Weekly";
  if (TimeFrame == PERIOD_MN1) ls_0 = "Monthly";
  if (TimeFrame == PERIOD_H1) ls_8 = "1 Hourly";
  if (TimeFrame == PERIOD_H4) ls_8 = "4 Hourly";
  if (TimeFrame == PERIOD_D1) ls_8 = "IntraDay";
  if (TimeFrame == PERIOD_W1) ls_8 = "IntraWeek";
  if (TimeFrame == PERIOD_MN1) ls_8 = "IntraMonth";
  if (ObjectFind("LongFibo" + Fibo_Num + "") == -1) ObjectCreate("LongFibo" + Fibo_Num + "", OBJ_FIBO, 0, g_datetime_120, g_price_96 + gd_112, g_datetime_120, g_price_96);
  else {
     ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_TIME2, g_datetime_120);
     ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_TIME1, g_datetime_120);
     ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_PRICE1, g_price_96 + gd_112);
     ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_PRICE2, g_price_96);
  }
  ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_LEVELCOLOR, Upper_color);
  ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_FIBOLEVELS, 4);
  ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_FIRSTLEVEL, 0.34);
  ObjectSetFiboDescription("LongFibo" + Fibo_Num + "", 0, "" + ls_0 + " Long Target 1 -  %$");
  ObjectSet("LongFibo" + Fibo_Num + "", 211, 0.55);
  ObjectSetFiboDescription("LongFibo" + Fibo_Num + "", 1, "" + ls_0 + " Long Target 2 -  %$");
  ObjectSet("LongFibo" + Fibo_Num + "", 212, 0.764);
  ObjectSetFiboDescription("LongFibo" + Fibo_Num + "", 2, "" + ls_0 + " Long Target 3 -  %$");
  ObjectSet("LongFibo" + Fibo_Num + "", 213, 1.764);
  ObjectSetFiboDescription("LongFibo" + Fibo_Num + "", 3, "" + ls_0 + " Long Target 4 -  %$");
  ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_RAY, TRUE);
  ObjectSet("LongFibo" + Fibo_Num + "", OBJPROP_BACK, TRUE);
  if (ObjectFind("ShortFibo" + Fibo_Num + "") == -1) ObjectCreate("ShortFibo" + Fibo_Num + "", OBJ_FIBO, 0, g_datetime_120, g_price_104 - gd_112, g_datetime_120, g_price_104);
  else {
     ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_TIME2, g_datetime_120);
     ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_TIME1, g_datetime_120);
     ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_PRICE1, g_price_104 - gd_112);
     ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_PRICE2, g_price_104);
  }
  ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_LEVELCOLOR, Lower_color);
  ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_FIBOLEVELS, 4);
  ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_FIRSTLEVEL, 0.34);
  ObjectSetFiboDescription("ShortFibo" + Fibo_Num + "", 0, "" + ls_0 + " Short Target 1 -  %$");
  ObjectSet("ShortFibo" + Fibo_Num + "", 211, 0.55);
  ObjectSetFiboDescription("ShortFibo" + Fibo_Num + "", 1, "" + ls_0 + " Short Target 2 -  %$");
  ObjectSet("ShortFibo" + Fibo_Num + "", 212, 0.764);
  ObjectSetFiboDescription("ShortFibo" + Fibo_Num + "", 2, "" + ls_0 + " Short Target 3 -  %$");
  ObjectSet("ShortFibo" + Fibo_Num + "", 213, 1.764);
  ObjectSetFiboDescription("ShortFibo" + Fibo_Num + "", 3, "" + ls_0 + " Short Target 4 -  %$");
  ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_RAY, TRUE);
  ObjectSet("ShortFibo" + Fibo_Num + "", OBJPROP_BACK, TRUE);
  if (ObjectFind("IntradayFibo" + Fibo_Num + "") == -1) ObjectCreate("IntradayFibo" + Fibo_Num + "", OBJ_FIBO, 0, g_datetime_120, g_price_96, g_datetime_120 + 60 * TimeFrame, g_price_104);
  else {
     ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_TIME2, g_datetime_120);
     ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_TIME1, g_datetime_120 + 60 * TimeFrame);
     ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_PRICE1, g_price_96);
     ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_PRICE2, g_price_104);
  }
  ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_LEVELCOLOR, Intra_color);
  ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_FIBOLEVELS, 7);
  ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_FIRSTLEVEL, 0.0);
  ObjectSetFiboDescription("IntradayFibo" + Fibo_Num + "", 0, "" + ls_8 + " Low -  %$");
  ObjectSet("IntradayFibo" + Fibo_Num + "", 211, 0.191);
  ObjectSetFiboDescription("IntradayFibo" + Fibo_Num + "", 1, "" + ls_8 + " S1 -  %$");
  ObjectSet("IntradayFibo" + Fibo_Num + "", 212, 0.382);
  ObjectSetFiboDescription("IntradayFibo" + Fibo_Num + "", 2, "" + ls_8 + " Short -  %$");
  ObjectSet("IntradayFibo" + Fibo_Num + "", 213, 0.5);
  ObjectSetFiboDescription("IntradayFibo" + Fibo_Num + "", 3, "" + ls_8 + " Pivot -  %$");
  ObjectSet("IntradayFibo" + Fibo_Num + "", 214, 0.618);
  ObjectSetFiboDescription("IntradayFibo" + Fibo_Num + "", 4, "" + ls_8 + " Long -  %$");
  ObjectSet("IntradayFibo" + Fibo_Num + "", 215, 0.809);
  ObjectSetFiboDescription("IntradayFibo" + Fibo_Num + "", 5, "" + ls_8 + " R1 -  %$");
  ObjectSet("IntradayFibo" + Fibo_Num + "", 216, 1.0);
  ObjectSetFiboDescription("IntradayFibo" + Fibo_Num + "", 6, "" + ls_8 + " High -  %$");
  ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_RAY, TRUE);
  ObjectSet("IntradayFibo" + Fibo_Num + "", OBJPROP_BACK, TRUE);
  return (0);
}

int start() {
  int li_0 = iBarShift(NULL, TimeFrame, Time[0]) + 1;
  g_price_96 = iHigh(NULL, TimeFrame, li_0);
  g_price_104 = iLow(NULL, TimeFrame, li_0);
  g_datetime_120 = iTime(NULL, TimeFrame, li_0);
  if (TimeDayOfWeek(g_datetime_120) == 0) {
     g_price_96 = MathMax(g_price_96, iHigh(NULL, TimeFrame, li_0 + 1));
     g_price_104 = MathMin(g_price_104, iLow(NULL, TimeFrame, li_0 + 1));
  }
  gd_112 = g_price_96 - g_price_104;
  DrawFibo();
  string l_text_4 = "";
  string l_text_12 = "";
  if (TimeFrame == PERIOD_M1) {
     l_text_4 = "ERROR: Incorrect Fibo TimeFrame";
     l_text_12 = "Use only H1/H4/D1/W1/MN1";
  }
  if (TimeFrame == PERIOD_M5) {
     l_text_4 = "ERROR: Incorrect Fibo TimeFrame";
     l_text_12 = "Use only H1/H4/D1/W1/MN1";
  }
  if (TimeFrame == PERIOD_M15) {
     l_text_4 = "ERROR: Incorrect Fibo TimeFrame";
     l_text_12 = "Use only H1/H4/D1/W1/MN1";
  }
  if (TimeFrame == PERIOD_M30) {
     l_text_4 = "ERROR: Incorrect Fibo TimeFrame";
     l_text_12 = "Use only H1/H4/D1/W1/MN1";
  }
  ObjectDelete("Fibo" + Fibo_Num + "");
  ObjectCreate("Fibo" + Fibo_Num + "", OBJ_LABEL, 0, 0, 0);
  ObjectSetText("Fibo" + Fibo_Num + "", l_text_4, 20, "Verdana", Intra_color);
  ObjectSet("Fibo" + Fibo_Num + "", OBJPROP_CORNER, 1);
  ObjectSet("Fibo" + Fibo_Num + "", OBJPROP_XDISTANCE, 20);
  ObjectSet("Fibo" + Fibo_Num + "", OBJPROP_YDISTANCE, 36);
  ObjectDelete("Fibo1" + Fibo_Num + "");
  ObjectCreate("Fibo1" + Fibo_Num + "", OBJ_LABEL, 0, 0, 0);
  ObjectSetText("Fibo1" + Fibo_Num + "", l_text_12, 20, "Verdana", Intra_color);
  ObjectSet("Fibo1" + Fibo_Num + "", OBJPROP_CORNER, 1);
  ObjectSet("Fibo1" + Fibo_Num + "", OBJPROP_XDISTANCE, 20);
  ObjectSet("Fibo1" + Fibo_Num + "", OBJPROP_YDISTANCE, 66);
  return (0);
}

Link to comment
Share on other sites

Re: Interesting Fib indicator

 

:(( mirror this indi please someone. 4sh@red is good.

heelp :((

 

I've tried copy>paste>compile>restart but nothing happenes.

:(

who would this kudos go to :)>-

 

http://www.4shared.com/file/187175358/ea94acc1/indicators.html

 

Have a nice day

One obvious truth.FOREX IS ANYTHING BUT EASY
Link to comment
Share on other sites

Re: Interesting Fib indicator

 

Thank you .. 4XMETER ...

 

I Recomended this Fibo indi.....

 

http://img695.imageshack.us/img695/9456/fibo.gif

 

TQ

 

 

Pls could someone share or tell me where to find the magic indicator attached on this chart ????

 

thanks in advance

 

Mods : Here.. in one package a Cloning Lindencourt FX

http://www.indo-investasi.com/viewtopic.php?f=48&t=7221&sid=d142cc2ada656aef24602f5b50f56b70
One obvious truth.FOREX IS ANYTHING BUT EASY
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...