Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 04:38:34 +0000



Post From: Price changes count within bar

[2013-12-23 13:17:47]
Zosimus - Posts: 345
Hi,

I don't know how to get correct price movement counting for past bars because I don't know how to access the tick by tick changes within the past bars BUT I can change the code to show the price movement counting for all bars from the moment you start your SC and forward. (You can get the results for past bars by running a Chart Replay).

I am attaching 2 files.

1. PriceChangeCounter_1 - This study shows the counting of the price movements for all the bars from the moment you start the study. The numbers are displayed as Bars (Place the study on one the of the regions below the price).

2. Changes_Movement_Ratio - This study calculates the Ratio between the total Movement that the bar made from Open to Close and the number of price movemenmts that happened within the Bar. So if price moved 10 ticks from open to close and there were 40 price changes during the bar then you will get 10/40 = 0.25 .
I think this is what you meant when you wrote "Eventually I want to be able to compare the number of price changes within a bar to how far price actually moved from open to close within the bar to see how much imbalance there was between buyers and sellers." This study also displays the results for all the bars from the moment you start the study and forward.
Date Time Of Last Edit: 2013-12-23 13:20:32
attachmentPriceChangeCounter_1.cpp - Attached On 2013-12-23 13:17:16 UTC - Size: 1.71 KB - 664 views
attachmentChanges_Movement_Ratio.cpp - Attached On 2013-12-23 13:17:40 UTC - Size: 1.87 KB - 652 views