Sunday, August 12, 2012

http://codebase.mql4.com/262 stock01

http://codebase.mql4.com/262


MQL4 - automated forex trading /

Code Base

Take part in Automated Trading Championship 2012 and Prove That You are the Best!
Code Base Indicators Parabolic SAR, Parabolic To post a new code, please log in or register
Download MetaTrader 5 and visit MQL5.community Code Base
and Trade on the Go!
Prepare for the Championship
Couldn't find the right code? Order it in the Jobs section

This library is for
MetaTrader 4
Download MT 4 - 455 Kb

and Trade on the Go!
Name:
Parabolic SAR, Parabolic
Author:MetaQuotes (2005.11.29 12:55)
Downloaded:8631
Download:
Parabolic Sub.mq4 (7.4 Kb) View

Parabolic SAR Technical Indicator was developed for analyzing the trending markets. The indicator is constructed on the price chart. This indicator is similar to the Moving Average Indicator with the only difference that Parabolic SAR moves with higher acceleration and may change its position in terms of the price. The indicator is below the prices on the bull market (Up Trend), when it’s bearish (Down Trend), it is above the prices.


If the price crosses Parabolic SAR lines, the indicator turns, and its further values are situated on the other side of the price. When such an indicator turn does take place, the maximum or the minimum price for the previous period would serve as the starting point. When the indicator makes a turn, it gives a signal of the trend end (correction stage or flat), or of its turn.
The Parabolic SAR is an outstanding indicator for providing exit points. Long positions should be closed when the price sinks below the SAR line, short positions should be closed when the price rises above the SAR line. It is often the case that the indicator serves as a trailing stop line.
If the long position is open (i.e., the price is above the SAR line), the Parabolic SAR line will go up, regardless of what direction the prices take. The length of the SAR line movement depends on the scale of the price movement.
Calculation
SAR(i) = SAR(i-1)+ACCELERATION*(EPRICE(i-1)-SAR(i-1))
Where:
SAR(i-1) — is the value of the indicator on the previous bar;
ACCELERATION — is the acceleration factor;
EPRICE(i-1) — is the highest (lowest) price for the previous period (EPRICE=HIGH for long positions and EPRICE=LOW for short positions).
The indicator value increases if the price of the current bar is higher than previous bullish and vice versa. The acceleration factor (ACCELERATION) will double at the same time, which would cause Parabolic SAR and the price to come together. In other words, the faster the price grows or sinks, the faster the indicator approaches the price.

Technical Indicator Description

Full description of Parabolic is available in the Technical analysis: Parabolic SAR
4 comments To post a new comment, please log in or register
This indicator is named the Stop And Reverse, SAR, Parabolic. A parabola is one of the three possible conic sections (others being ellipse [the circle is a special case of an ellipse] and hyperbola). Why is this indicator named parabolic?
The next question... What exact parameters in the MQL4 Parabolic SAR indicator code could make it an ellipsoidal shape/surface or a hyperbolic if indeed some set parameters make it parabolic?
The aim of my question(s) have to do with a question of mathematical eccenntricity (from wikipedia on conic sections):
Eccentricity
Ellipse (e=1/2), parabola (e=1) and hyperbola (e=2) with fixed focus F and directrix.
The four defining conditions above can be combined into one condition that depends on a fixed point F (the focus), a line L (the directrix) not containing F and a nonnegative real number e (the eccentricity). The corresponding conic section consists of all points whose distance to F equals e times their distance to L. For 0 < e < 1 we obtain an ellipse, for e = 1 a parabola, and for e > 1 a hyperbola.
The objective is for research and development of a 'SAR ellipsoid' and 'SAR Hyberbolic' indicators. It is further for development of a (continuous [24hrs]) 'time series wobble' type of model that is based on the physical phenomenon of a rattleback (rattleback from wikipedia):
A rattleback, also known as an "anagyre", "celt", "Celtic stone", "rebellious celt", "rattlerock", "spin bar", "wobble stone" or "wobblestone" and by the product names "ARK," "Bizzaro Swirls," "RATTLEBACKS," "Space Pet" and "Space Toy," is a semi-ellipsoidal topwhich will spin on its axis in a preferred direction. But, if spun in the opposite direction, it becomes unstable, "rattles", stops and reverses its spin to the preferred direction.
Behold the mysterious celt, with a property that amuses. One way it will spin, the other way it refuses.
This spin-reversal motion seems, at first sight, to violate the angular-momentum conservation law of physics...
22.01.2009 00:45 FXrules
swipes wrote:
sub wrote:

The built-in Parabolic SAR and Parabolic.mq4 will give different results when overlaid. Everything is a OK on refresh. However, as new bars are formed there are different results. This problem was corrected in Parabolic-Fix.mq4 which gives same results as built-in parabolic.
Where can i try it form
The Parabolic Sub.mq4 above is the modified version. See Fix1 note inside.
14.10.2008 11:30 sub
sub wrote:

The built-in Parabolic SAR and Parabolic.mq4 will give different results when overlaid. Everything is a OK on refresh. However, as new bars are formed there are different results. This problem was corrected in Parabolic-Fix.mq4 which gives same results as built-in parabolic.
Where can i try it form
13.03.2007 01:36 swipes

The built-in Parabolic SAR and Parabolic.mq4 will give different results when overlaid. Everything is a OK on refresh. However, as new bars are formed there are different results. This problem was corrected in Parabolic-Fix.mq4 which gives same results as built-in parabolic.
07.09.2006 07:54 sub

No comments:

Post a Comment