# Tutorial 170 | Looking for a chart pattern on several symbols using PSPs

Tutorial 170 demonstrates how multiple symbols can be loaded on a chart by using several price series providers (PSPs) to test for a specific condition (in this example a simple hammer pattern).

With tutorial 170 a list of stocks is stored in a text file stored on the local computer. This file is read into the program using the StreamReader and the names of the stocks stored in a TokenList after having been checked by another method that they are a valid symbol. Once the data has been downloaded a loop creates a PSP for each symbol in turn. The PSPs are stored in a vector. Update and state changed events are also created for each PSP.

Tutorial 170 monitors the state changed and update events for each PSP. When the PSP is first loaded and when each PSP closes, it performs a calculation to see if a simple candlestick pattern has occurred.

The tutorial contains some of the same techniques as _QuickTip37 (see https://markplex.com/free-tutorials/)
Program 71 (see https://markplex.com/easylanguage-programs/program-71-multiple-timeframe-averages-analysis/)

### Hammer pattern

In this program, the hammer pattern is defined as when the body of the candle is relatively small compared to the wick and occurs above the middle horizontal line shown in the image to the right. A user input: BarPercentage determines the exact position of the middle horizontal line.

Similarly, an inverse hammer pattern is defined as when the body of the candle is relatively small compared to the wick and occurs below the middle horizontal line. For inverse hammer patterns the position of the middle line is measured from the high of the bar.

The formulae for determining the patterns are:

#### Hammer definition

HiBar = Open > ( ( High – Low ) * BarPercentage / 100 ) + Low and Close > ( ( High – Low ) * BarPercentage / 100 ) + Low;

#### Inverse hammer definition

LoBar = Open < High – ( ( High – Low ) * BarPercentage / 100 ) and Close < High – ( ( High – Low ) * BarPercentage / 100 );

It would be relatively straightforward to modify this if you required a more stringent definition of a hammer (for example, if the close or open had to be near or at the top of the bar for a hammer pattern).

Tutorial 170 uses a lot of resources, depending on the number of symbols loaded, how much history is included and the bar interval. This resource requirement can be decreased by reducing the number of symbols and history however, in testing, there were occasional problems with TradeStation hanging due to excessive resource use when the program was left to run.  Probably the best way to use this program would be to run it, see the results for the latest bar, and then turn the status to off. Retests of future bars can be done by changing the status to on.