How To Compute Support and Resistance levels in Visual Basic?

Member

by annalise , in category: Technical Analysis , a month ago

How To Compute Support and Resistance levels in Visual Basic?

Facebook Twitter LinkedIn Whatsapp

1 answer

by ayana_reilly , a month ago

@annalise 

To compute support and resistance levels in Visual Basic, you can follow these steps:

  1. Define your data: Get historical price data for the stock or security you are analyzing. Define a period of time for which you want to calculate support and resistance levels (e.g. 20 days, 50 days, etc.).
  2. Calculate the Pivot Point: To calculate the Pivot Point, add the high, low, and close prices of the previous day and divide the sum by 3. Pivot Point = (Previous High + Previous Low + Previous Close) / 3
  3. Calculate Support and Resistance levels: Calculate the first support level: S1 = (2 * Pivot Point) - Previous High Calculate the second support level: S2 = Pivot Point - (Previous High - Previous Low) Calculate the first resistance level: R1 = (2 * Pivot Point) - Previous Low Calculate the second resistance level: R2 = Pivot Point + (Previous High - Previous Low)
  4. Implement the calculations in your Visual Basic code: Write Visual Basic functions or subroutines to compute the Pivot Point, support, and resistance levels based on the historical price data. Use loops to iterate through the historical price data and calculate the support and resistance levels for each period. You can also create a user interface to input the historical price data and display the calculated support and resistance levels.
  5. Test and validate your code: Test your code with different historical price data and compare the calculated support and resistance levels with the actual levels observed in the market. Make adjustments to your code as needed to improve accuracy and reliability.


By following these steps, you can compute support and resistance levels in Visual Basic for a given security or stock based on historical price data.