Jag skulle vilja använda PDI(p) & MDI i ett Extra Objekt.
Är det ngn som redan har skrivit ner formeln för PDI i scriptform o har lust att dela med sig.
MVH Ola
To calculate the Directional Movement System:
Calculate the Directional movement for today
+DM = Today's High - Yesterday's High (when price moves upward)
-DM = Yesterday's Low - Today's Low (when price moves downward)
You cannot have both +DM and -DM on the same day. If there is an outside day (where both calculations are positive) then the larger of the two results is taken. An inside day (where both calculations are negative) will always equal zero.
Calculate the true range for the day. True range is the largest of:
Today's High - Today's Low,
Today's High - Yesterday's Close, and
Yesterday's Close - Today's Low
+DM14 = exponential moving average* of +DM
-DM14 = exponential moving average* of -DM
TR14 = exponential moving average* of True Range
Next, calculate the Directional Indicators:
+DI14 = +DM14 divided by TR14
-DI14 = -DM14 divided by TR14
Then, calculate the components of the Average Directional Movement Index (ADX):
Calculate the DI Difference:
Record the difference between +DI14 and -DI14 as a positive number.
Calculate the Directional Index (DX):
DX = DI Difference divided by the sum of +DI14 and -DI14
ADX = the exponential moving average* of DX
Är det ngn som redan har skrivit ner formeln för PDI i scriptform o har lust att dela med sig.
MVH Ola
To calculate the Directional Movement System:
Calculate the Directional movement for today
+DM = Today's High - Yesterday's High (when price moves upward)
-DM = Yesterday's Low - Today's Low (when price moves downward)
You cannot have both +DM and -DM on the same day. If there is an outside day (where both calculations are positive) then the larger of the two results is taken. An inside day (where both calculations are negative) will always equal zero.
Calculate the true range for the day. True range is the largest of:
Today's High - Today's Low,
Today's High - Yesterday's Close, and
Yesterday's Close - Today's Low
+DM14 = exponential moving average* of +DM
-DM14 = exponential moving average* of -DM
TR14 = exponential moving average* of True Range
Next, calculate the Directional Indicators:
+DI14 = +DM14 divided by TR14
-DI14 = -DM14 divided by TR14
Then, calculate the components of the Average Directional Movement Index (ADX):
Calculate the DI Difference:
Record the difference between +DI14 and -DI14 as a positive number.
Calculate the Directional Index (DX):
DX = DI Difference divided by the sum of +DI14 and -DI14
ADX = the exponential moving average* of DX
Comment