Can it be made mtf?mladen wrote: Fri May 12, 2017 6:30 pm New version of linear regression sketcher ...
- upgraded code
- using the new set of prices (the 33 types of prices)
- some minor changes made
lr sketcher.png
Re: Experiments ...
102Just food for thoughtmladen wrote: Tue May 02, 2017 2:53 am Whenever you move something from sub-window to the chart, you are approximating that to some other value (in most of the cases average, high low channel, or something similar)
So, what you are asking is not possible since the DMI would be approximated to some other value and it would show something actually not related to real prices at all
If indicators, which are based on close price value, could forward calculation predict a zero/cross point. I don't have much knowledge in this field. I am not specifically talking about DMI as I only assume it is calculated using Close price values.
For instance
DMI cross over point should be able to be predicted if we know how much the price needs to return for crossover to occur, then this can be plotted on chart.
Changing the close price to find crossover then plotting it on chart.
I assume only indicators based solely on close value should be able to be predicted, but your more knowledgeable.
If possible what can this be applied to and how can we expand it?
Re: Experiments ...
103Some more information how DMI is calculatedSanni123 wrote: Mon May 15, 2017 9:44 am Just food for thought
If indicators, which are based on close price value, could forward calculation predict a zero/cross point. I don't have much knowledge in this field. I am not specifically talking about DMI as I only assume it is calculated using Close price values.
For instance
DMI cross over point should be able to be predicted if we know how much the price needs to return for crossover to occur, then this can be plotted on chart.
Changing the close price to find crossover then plotting it on chart.
I assume only indicators based solely on close value should be able to be predicted, but your more knowledgeable.
If possible what can this be applied to and how can we expand it?
Code: Select all
To calculate +DI and −DI, one needs price data consisting of high, low, and closing prices each period (typically each day). One first calculates the directional movement (+DM and −DM):
UpMove = today's high − yesterday's high
DownMove = yesterday's low − today's low
if UpMove > DownMove and UpMove > 0, then +DM = UpMove, else +DM = 0
if DownMove > UpMove and DownMove > 0, then −DM = DownMove, else −DM = 0
After selecting the number of periods (Wilder used 14 days originally), +DI and −DI are:
+DI = 100 times the smoothed moving average of (+DM) divided by average true range
−DI = 100 times the smoothed moving average of (−DM) divided by average true range
The smoothed moving average is calculated over the number of periods selected, and the average true range is a smoothed average of the true ranges. Then:
A.D.X. = 100 times the smoothed moving average of the absolute value of (+DI − −DI) divided by (+DI + −DI)
Variations of this calculation typically involve using different types of moving averages, such as an exponential moving average, a weighted moving average or an adaptive moving average.
Re: Experiments ...
104Dearest Mladen and Sanni 123,mladen wrote: Mon May 15, 2017 4:15 pm Some more information how DMI is calculated
Please check how that could fit in your ideaCode: Select all
To calculate +DI and −DI, one needs price data consisting of high, low, and closing prices each period (typically each day). One first calculates the directional movement (+DM and −DM): UpMove = today's high − yesterday's high DownMove = yesterday's low − today's low if UpMove > DownMove and UpMove > 0, then +DM = UpMove, else +DM = 0 if DownMove > UpMove and DownMove > 0, then −DM = DownMove, else −DM = 0 After selecting the number of periods (Wilder used 14 days originally), +DI and −DI are: +DI = 100 times the smoothed moving average of (+DM) divided by average true range −DI = 100 times the smoothed moving average of (−DM) divided by average true range The smoothed moving average is calculated over the number of periods selected, and the average true range is a smoothed average of the true ranges. Then: A.D.X. = 100 times the smoothed moving average of the absolute value of (+DI − −DI) divided by (+DI + −DI) Variations of this calculation typically involve using different types of moving averages, such as an exponential moving average, a weighted moving average or an adaptive moving average.
Above is based on the same request i did sometime ago. The logic was to: "Calculate the Eventual price THAT could MEET a Specific CRITERIA". My request was based on a Simple Moving Average. In Technical Analysis the Cross of a Moving Average and the Prices, is giving a Signal to Open or Close a Position. Suppose we use a Simple MA, it would be helpful if we could know the crossing point with Prices .... As it is not possible to Predict-Calculate such Price, we can try to calculate it by "making an hypothesis" by imposing following question ... What should be the Close Price of the actual Bar in order to make the MA and Prices to Cross ??? .... The result of such calculation can be used for different purposes, like Take Profit, Stop Loss, Close Position and Open Position ... Using this logic, many similar calculations could be made, like the idea of Sanni123 ... Unfortunately i do not have coding knowledge in order to realize such indicator-calculation ...
Thank you for your attention.
Best Regards
Dimitri
Re: Experiments ...
105As far as I see this would be itDimitri wrote: Mon May 15, 2017 10:48 pm Dearest Mladen and Sanni 123,
Above is based on the same request i did sometime ago. The logic was to: "Calculate the Eventual price THAT could MEET a Specific CRITERIA". My request was based on a Simple Moving Average. In Technical Analysis the Cross of a Moving Average and the Prices, is giving a Signal to Open or Close a Position. Suppose we use a Simple MA, it would be helpful if we could know the crossing point with Prices .... As it is not possible to Predict-Calculate such Price, we can try to calculate it by "making an hypothesis" by imposing following question ... What should be the Close Price of the actual Bar in order to make the MA and Prices to Cross ??? .... The result of such calculation can be used for different purposes, like Take Profit, Stop Loss, Close Position and Open Position ... Using this logic, many similar calculations could be made, like the idea of Sanni123 ... Unfortunately i do not have coding knowledge in order to realize such indicator-calculation ...
Thank you for your attention.
Best Regards
Dimitri
Try it out (the "prediction" calculation as it is calculated in this example is possible only for SMA - other averages types would have completely different "prediction" calculation). The dotted line is the actual SMA, and the "blue" line is the required price that would cause crossing of the SMA and the price
Re: Experiments ...
106I assume only indicators which calculate starting from and solely the close/any 'single' value can be used to predict zero/cross over points. From above understanding DMI uses high, low, and close values. Therefore may be more difficult to predict zero point.mladen wrote: Tue May 16, 2017 12:06 am As far as I see this would be it
Try it out (the "prediction" calculation as it is calculated in this example is possible only for SMA - other averages types would have completely different "prediction" calculation). The dotted line is the actual SMA, and the "blue" line is the required price that would cause crossing of the SMA and the price
sma cross prediction.png
I think there are many indicators which calculate starting solely from close price, so prediction should be possible by varying the close price to find zero/cross point.
As for DMI, it may be possible but not true to indicator. Just by varying the close price which will inturn have a effect on high/low values respectively.
Lets assume a bullish trend indicated by the DMI. At the close of candle. Adjust close price and make it lower, maybe lower than the intial low price value, to the point when DMI lines cross. By this forward calculation we should know what close value is meeded for the cross over to occur. Then plot that on graph
Re: Experiments ...
107Combinations when two or more prices need to be "predicted" are making the "prediction" literally impossible (too many possible combinations - regardless of the type of calculation)
Re: Experiments ...
108Dearest Mladen,
I have really to Thank YOU so much for your immense supporting all of us ...
I notice that the graphic impression i have from the result, is not compatible with what i was optically expecting. As i already told you, i have no coding knowledge, but i can express mathematically my thinking ... Point 1.: I Agree that simple MA is the non complicate of other MA's. Point 2.: It is really great the possibility to use all those prices you have included. Point 3.: i will try to give you an example of the calculation : Suppose we use a Simple MA of Close Price for the last 5 Periods without counting the active non closed bar. The calculation for the Simple 5 periods MA is : Last Closed Bar which we give the name Close_1, the previous of that is Close_2 ... up to Close_5. We add Close_1+Close_2+Close_3+Close_4+Close_5 and we divide the sum by 5. This should be the MA price. Now as we want to "calculate-predict" what should be the price in order to "cross the MA with Prices", we assume that MA=Price, or (X+Close_1+Close_2+Close_3+Close_4)/5= X (where X should be the "predicted Closing Price of the ACTIVE Bar") ... Please just confirm calculation. Thank you Thank you Thank you ....
Best Regards
Dimitri
I have really to Thank YOU so much for your immense supporting all of us ...
I notice that the graphic impression i have from the result, is not compatible with what i was optically expecting. As i already told you, i have no coding knowledge, but i can express mathematically my thinking ... Point 1.: I Agree that simple MA is the non complicate of other MA's. Point 2.: It is really great the possibility to use all those prices you have included. Point 3.: i will try to give you an example of the calculation : Suppose we use a Simple MA of Close Price for the last 5 Periods without counting the active non closed bar. The calculation for the Simple 5 periods MA is : Last Closed Bar which we give the name Close_1, the previous of that is Close_2 ... up to Close_5. We add Close_1+Close_2+Close_3+Close_4+Close_5 and we divide the sum by 5. This should be the MA price. Now as we want to "calculate-predict" what should be the price in order to "cross the MA with Prices", we assume that MA=Price, or (X+Close_1+Close_2+Close_3+Close_4)/5= X (where X should be the "predicted Closing Price of the ACTIVE Bar") ... Please just confirm calculation. Thank you Thank you Thank you ....
Best Regards
Dimitri
Re: Experiments ...
109DimitriDimitri wrote: Tue May 16, 2017 1:22 am Dearest Mladen,
I have really to Thank YOU so much for your immense supporting all of us ...
I notice that the graphic impression i have from the result, is not compatible with what i was optically expecting. As i already told you, i have no coding knowledge, but i can express mathematically my thinking ... Point 1.: I Agree that simple MA is the non complicate of other MA's. Point 2.: It is really great the possibility to use all those prices you have included. Point 3.: i will try to give you an example of the calculation : Suppose we use a Simple MA of Close Price for the last 5 Periods without counting the active non closed bar. The calculation for the Simple 5 periods MA is : Last Closed Bar which we give the name Close_1, the previous of that is Close_2 ... up to Close_5. We add Close_1+Close_2+Close_3+Close_4+Close_5 and we divide the sum by 5. This should be the MA price. Now as we want to "calculate-predict" what should be the price in order to "cross the MA with Prices", we assume that MA=Price, or (X+Close_1+Close_2+Close_3+Close_4)/5= X (where X should be the "predicted Closing Price of the ACTIVE Bar") ... Please just confirm calculation. Thank you Thank you Thank you ....
Best Regards
Dimitri
Please check the code - when you take the math needed to "predict" the price at which the price and sma will cross, it does exactly what is needed. The math is simple :
sma + (future price-price(sma periods ago))/sma period = future price
simplify it and you shall see how it can be calculated
Re: Experiments ...
110Dear Mladen,mladen wrote: Tue May 16, 2017 1:00 am Combinations when two or more prices need to be "predicted" are making the "prediction" literally impossible (too many possible combinations - regardless of the type of calculation)
What you say is 100% correct. That is why this type of calculation should be done when looking for a unique value or a"Cross Effect".
Best Regards
Dimitri