Click here to Login

LiveZilla Live Help
LiveZilla Live Help
Trading Software Trading objects Features How-to Blog Search



Fibonacci retracement: Golden ratio

by bug man, 704 days ago
Share |

This function calculates the Fibonacci retracement 61.8% level, also referred to as 'the golden mean' or 'the golden ratio'. It uses simple vector-based functions to do this. The function accepts one parameter which is the lookback period to use to define the highest and lowest close prices.
Fibonacci retracement is a very popular tool used by many traders. It is based on the key numbers identified by mathematician Leonardo Fibonacci to calculate the Fibonacci ratios. These ratios levels are then used to identify critical points that could cause an asset's price to reverse.

As I said earlier, the calculation is rather simple. First of all we need to determine the difference between the highest and lowest close prices for the defined lookback period. We store this data into a variable whose name is (dif). The second step is to try to determine which of the highest or lowest close price occurred first; this is done using the (BarsSince) formula. Depending on the last result, we calculate the 61.8% level. In case the highest close price happened before the lowest close price, the variable 'dif' (calculated previously) is multiplied by 0.618. In the other case, the same variable 'dif' is multiplied by (1 - 0.618). We finally add the lowest close price value to the 61.8% level value and plot the resulting time-series.

We can create a bar chart that displays the difference between the current price and the 61.8% Fibonacci level by subtracting this level to the close price.

In order to create a time-series that plots other Fibonacci ratio levels like the 23.6% ratio or the 38.2% ratio, you just need to change the "level" variable. For the 23.6% level, just replace the value (0.618) by (0.236). You can also easily tweak the code and offer the possibility to define the Fibonacci ratio level by adding another parameter to this function.


Share This ->
Share |


You have to log in to bookmark this object
What is this?
Additional Information



>>>> More trading objects? click here to search for trading sytems, downloaders, screens, custom drawing tools, indicators... by country, market or style.

>>>> To get this item and hundreds of other items, click here to join and download the Best Trading Software for Free .



No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Write a review one review Number of downloads 54 downloads Notes Report an item


Type: Trading Indicator

Object ID: 161


Country:
All

Market: All

Style:
Technical Analysis




Related Trading Objects



Country
Page 1
Trading the Equity Curve
by QuantShare, uploaded several months ago


No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 4 Notes Report an item
Opening Range Breakout Indicator
by QuantShare, uploaded several months ago
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 3 Notes Report an item
Wilder's Smoothing - Moving Average
by QuantShare, uploaded several months ago
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 9 Notes Report an item
Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object









Join now
and get instant access for free to the trading software, the Sharing server and the Social network website.
Click here


Related objects
Show All
U.S. Stock Market (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 853 Notes Report an item
Historical Stock Market Data (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 1304 Notes Report an item
Elliott Wave Oscillator (by Caleb, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 21 Notes Report an item
Number of Stocks Making a new 52-Week Low - Market Indicator (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 11 Notes Report an item
Fisher Transform - Technical Indicator (by bug man, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 38 Notes Report an item
Put/Call Ratio for Individual Stocks (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 17 Notes Report an item
Futures and Forex historical data (by Tom Huggens, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 763 Notes Report an item
Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

Technical Analysis


Fundamental Analysis


Forum Threads



Random Blog Posts

QuantShare - review by the Stock Trading Software Reviews

Rules performance for different volatility regimes

Improve your trading system performance by ranking stocks

Data snooping bias

A simple but useful way to display distances in a chart

How to create and backtest thousands of trading rules in less than 10 minutes

Limit and Market orders

How to filter quotes data from high and low price spikes

Show All

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object






QuantShare
Product
QuantShare
Features
Create an account
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2012 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items