Scan using OnBalanceVolume AccDist MACD and SMA’s


Category:
0
0

Hello Peter,

This is my ideas for scan. I want to turn this to a watch list and later on a strategies with your help.

  1. I just want a scan that plot me stocks when their OBV and AccDist raise about 10% comparing to the previous 5min or day close. This condition intersect with the 2 line MACD study when the value of MACD is above or equal to the moving average of MACD .
  2. OBV and AccDist raise about 10% comparing to the previous 5min or day close. This condition intersect with SMA20 above or equal to SMA50
  3. 2 line MACD study when the value of MACD is above or equal to the moving average of MACD intercept with SMA20 above or equal to SMA50.
Marked as spam
Posted by (Questions: 5, Answers: 2)
Asked on March 27, 2020 9:39 pm
95 views
0
Private answer

I had to update the title of your question to correct some typos and include all the elements you are requesting in this scan. You actually have 3 separate scans here. I can't only provide a partial solution here. The reason is that I have clients who have paid for less complex solutions so out of respect for those clients I cannot provide a free solution here.

There is only one portion of your request that cannot be accomplished using the Condition Wizard. So take some to review the following video to learn how to use that tool:

https://www.hahn-tech.com/thinkorswim-condition-wizard/

Using the Condition Wizard you can build portions of your request that use the MACD, and SMA's. So you only need custom code for the 10% rise of OBV and AccDist. Which I will provide here.

For the OnBalanceVolume:

def obv = TotalSum(Sign(close - close[1]) * volume);
plot scan = obv > obv[1] * 1.1;

For the AccDist

def accDist = TotalSum(volume * CloseLocationValue());
plot scan = accDist > accDist[1] * 1.1;

Each of those can be added to a separate study filter on your scan. Then you can build the rest of the elements in separate study filters using the Condition Wizard.

Final word of caution about these last two solutions I provided above. Each of them uses a function that computes the total sum of all bars on the chart. It will never be possible to get this to exactly match the values printed on the chart. This because the scan engine uses a fixed amount of historical bars based on the selected time frame. Details here:

https://toslc.thinkorswim.com/center/howToTos/thinkManual/Scan/Stock-Hacker/studyfilters

You will find that it's not possible to adjust the amount of historical data on a chart to match what is used by the scan. So any chart study that uses the function named TotalSum() are not good candidates for building scans. I'm sure this has already been explained elsewhere in the forum. But that is not something most folks would think to search for.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 28, 2020 9:17 am