• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 11:07am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 11:07am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Howto to get (current and last few bars) Price in mq4 EA 6 replies

Need help, I can't get the value of the buffer using Icustom() 5 replies

Howto Avoid Shorter/Partial Sessions... 2 replies

Howto get a Candle (High/Low/Open/Close) at any specific time 4 replies

Howto on volume ='mt4'|vol!eurusd 3 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: [Need Help] Howto get Fibonacci value?
Exit Attachments

[Need Help] Howto get Fibonacci value?

  • Post #1
  • Quote
  • First Post: Mar 26, 2008 6:00pm Mar 26, 2008 6:00pm
  •  Spade-Ace
  • | Joined Oct 2007 | Status: Member | 8 Posts
i try to build an indicator, but i have some problem here..i can't get the fibonacci value from fibonacci object.

here's the code :
ObjectCreate("dailyFibo",OBJ_FIBO,0,StartTime,HiPrice,StartTime+PERIOD_D1*60,LoPrice);
ObjectSet("dailyFibo",OBJPROP_FIRSTLEVEL+0,0.0); ObjectSetFiboDescription("dailyFibo",0,"");
ObjectSet("dailyFibo",OBJPROP_FIRSTLEVEL+1,0.236); ObjectSetFiboDescription("dailyFibo",1,"");
ObjectSet("dailyFibo",OBJPROP_FIRSTLEVEL+2,0.382); ObjectSetFiboDescription("dailyFibo",2,"");
ObjectSet("dailyFibo",OBJPROP_FIRSTLEVEL+3,0.500); ObjectSetFiboDescription("dailyFibo",3,"");
ObjectSet("dailyFibo",OBJPROP_FIRSTLEVEL+4,0.618); ObjectSetFiboDescription("dailyFibo",4,"");
ObjectSet("dailyFibo",OBJPROP_FIRSTLEVEL+5,0.764); ObjectSetFiboDescription("dailyFibo",5,"");
ObjectSet("dailyFibo",OBJPROP_FIRSTLEVEL+6,1.000); ObjectSetFiboDescription("dailyFibo",6,"");


So how can i get the value of "dailyfibo" object..
please someone help me..i'm newbie here...
  • Post #2
  • Quote
  • Mar 26, 2008 6:36pm Mar 26, 2008 6:36pm
  •  Royce
  • | Joined Mar 2008 | Status: Member | 25 Posts
I'm not sure what you want exactly.

Do you want to determine the percent distance a symbol's current price is between the fibo object's start and stop prices?

Assuming the price is actually between your HiPrice and LoPrice that would simply be (Bid - LoPrice) / (HiPrice - LoPrice). (Or use Ask depending on what you are doing.) The object itself isn't really needed if you can hang on to HiPrice and LoPrice.

If you can't hang on to HiPrice and LoPrice or if you are simply trying to read the fibo object's start and stop coordinates after you have created the object you just use ObjectGet("dailyFibo", OBJPROP_PRICE1) and OBJPROP_PRICE2, etc.

Hope that helps.
 
 
  • Post #3
  • Quote
  • Last Post: Mar 27, 2008 8:46pm Mar 27, 2008 8:46pm
  •  DooMGuarD
  • | Joined Jan 2008 | Status: Member | 1 Post
well... you have a Fibo 0% and Fibo 100%... then you can

PHP Code
 //+------------------------------------------------------------------+
//|                                                         Test.mq4 |
//|                                DooMGuarD Sistemas Especialistas. |
//|                                        http://dgforex.50webs.com |
//+------------------------------------------------------------------+
#property copyright "DooMGuarD Sistemas Especialistas."
#property link      "http://dgforex.50webs.com"
/************************************************
 **  Powered with DooMGuarD MetaTrader System  **
 **  Copyrigth 2006 by Charles Adriano         **
 **  http://dgforex.50webs.com                 **
 ************************************************/
int start()
{
  
MakeFibo(Time[0],High[0],Time[0],High[0]-100*Point);

  return(
0);
}

string FibName = "dailyFibo";
double Fb0, Fb1, Fb2, Fb3, Fb4, Fb5, Fb6;

void MakeFibo(datetime StartTime, double HiPrice, datetime EndTime,double LoPrice)
{ 
  
double Dif = HiPrice-LoPrice;
  
  
Fb0 = LoPrice + (Dif*0.000);
  
Fb1 = LoPrice + (Dif*0.236);
  
Fb2 = LoPrice + (Dif*0.382);
  
Fb3 = LoPrice + (Dif*0.500);
  
Fb4 = LoPrice + (Dif*0.618);
  
Fb5 = LoPrice + (Dif*0.764);
  
Fb6 = LoPrice + (Dif*1.000);

  
ObjectCreate(FibName,OBJ_FIBO,0,StartTime,HiPrice,EndTime,LoPrice);
  
WindowRedraw();
  
ObjectSet(FibName,OBJPROP_FIBOLEVELS,7); 
  
ObjectSet(FibName,OBJPROP_FIRSTLEVEL+0,0.000); 
  
ObjectSetFiboDescription(FibName,0,StringConcatenate("0% ",DoubleToStr(Fb0,Digits)));
  
ObjectSet(FibName,OBJPROP_FIRSTLEVEL+1,0.236); 
  
ObjectSetFiboDescription(FibName,1,StringConcatenate("23.6% ",DoubleToStr(Fb1,Digits)));
  
ObjectSet(FibName,OBJPROP_FIRSTLEVEL+2,0.382); 
  
ObjectSetFiboDescription(FibName,2,StringConcatenate("38.2% ",DoubleToStr(Fb2,Digits)));
  
ObjectSet(FibName,OBJPROP_FIRSTLEVEL+3,0.500); 
  
ObjectSetFiboDescription(FibName,3,StringConcatenate("50.0% ",DoubleToStr(Fb3,Digits)));
  
ObjectSet(FibName,OBJPROP_FIRSTLEVEL+4,0.618); 
  
ObjectSetFiboDescription(FibName,4,StringConcatenate("61.8% ",DoubleToStr(Fb4,Digits)));
  
ObjectSet(FibName,OBJPROP_FIRSTLEVEL+5,0.764); 
  
ObjectSetFiboDescription(FibName,5,StringConcatenate("76.4% ",DoubleToStr(Fb5,Digits)));
  
ObjectSet(FibName,OBJPROP_FIRSTLEVEL+6,1.000); 
  
ObjectSetFiboDescription(FibName,6,StringConcatenate("100.0% ",DoubleToStr(Fb6,Digits)));
  
WindowRedraw();

  return(
0);
} 
regards



NOTE: this is a script
Attached Image
 
 
  • Platform Tech
  • /
  • [Need Help] Howto get Fibonacci value?
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022