Hi,
I am using this indicator to insert in my chart a fibo tool I use for weekly fibo...
I use another one for daily fibo.... with a different color...
I'd like to change the thickness of fibo levels ... is it possible ??
How can I add code for changing the level thickness ??
Thank you in advance.
I am using this indicator to insert in my chart a fibo tool I use for weekly fibo...
I use another one for daily fibo.... with a different color...
Inserted Code
//+------------------------------------------------------------------+ //| testFibo.mq4 | //| Copyright © 2007, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2007, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window bool b_firstTimeFlag = true; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { if(b_firstTimeFlag) { double high = High[3]; double low = Low[3]; datetime time = Time[3]; bool result = createFib("fibdaily", time, low - 0.01, high + 0.01, Black, true); if(result == false) Print("error creating fib: ", GetLastError()); b_firstTimeFlag = false; }//end if first time return(0); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| function setFib | //+------------------------------------------------------------------+ bool createFib(string name, datetime date, double price1, double price2, color fibColor, bool bRayFlag) { bool ret = false; bool result = false; result = ObjectCreate(name, OBJ_FIBO, 0, date, price1, date, price2); Print("createFib: result = ", result); if(result == true) { //set the number of fib levels ObjectSet(name, OBJPROP_FIBOLEVELS, 13); //set the value of each fib level ObjectSet(name, OBJPROP_FIRSTLEVEL+1, 0.000); ObjectSet(name, OBJPROP_FIRSTLEVEL+3, 0.382); ObjectSet(name, OBJPROP_FIRSTLEVEL+4, 0.500); ObjectSet(name, OBJPROP_FIRSTLEVEL+5, 0.618); ObjectSet(name, OBJPROP_FIRSTLEVEL+8, 1.000); //set the description of each fib level ObjectSetFiboDescription(name, 1, "Resistenza W"); ObjectSetFiboDescription(name, 3, "Long weekly"); ObjectSetFiboDescription(name, 4, "Pivot weekly"); ObjectSetFiboDescription(name, 5, "Short weekly"); ObjectSetFiboDescription(name, 8, "Supporto W"); //set the ray flag ret = ObjectSet(name, OBJPROP_RAY, bRayFlag); //set the color of the fib ret = ObjectSet(name, OBJPROP_COLOR, fibColor); /////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////// I ADDED THIS, THIS IS WHAT YOU NEED TO PLAY WITH TO SET COLOR ////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////// //set the color of the fib levels ret = ObjectSet(name, OBJPROP_LEVELCOLOR, fibColor); /////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////// //debug code Print("color set: ", ret, ": color = ", fibColor); if(ret == 0) { Print("error: ", GetLastError());} //end debug code }//end if the fib object is created with no errors ret = result; return (ret); }//end function setFib
How can I add code for changing the level thickness ??
Thank you in advance.