CandleSticks Documentation [EN]

The CandleSticks indicator recognizes the 30 main candlestick patterns on the Prorealtime platform. It displays buy and sell signals on the chart, along with their price targets and safety stops. The screener will help you seize trading opportunities in real-time.

Indicator Installation

Before installing the CandleStick indicator, you must purchase a license or subscribe to the trial version. The indicator is available on the Prorealcode marketplace at this address:

https://market.prorealcode.com/product/candlesticks-indicator-screener

Installing the CandleStick indicator is quick and easy. Simply follow the standard installation procedure described on this page:

https://market.prorealcode.com/how-to-install-my-product-in-prorealtime

Launching the Indicator

After installing the license on your Prorealtime platform, the indicator will be available in the Indicators & Trading Systems window in the “ProRealCode MarketPlace” section.

To access the indicators window, click on the “Price” icon located in the price chart window, then on “Add Indicator…“:

Add Indicator Prorealtime

To access the indicator, refer to the “ProRealCode MarketPlace” section or type the name “CandleSticks” in the search bar. Double-click on the “CandleSticks” indicator to display it in the price window.

Why does the price chart become flat after loading the indicator?

The indicator returns buy and sell signals. This allows you to use the indicator to create alerts and backtests. It returns 1 for buy signals and -1 for sell signals. These values ​​are displayed by default on the price chart. This automatically adjusts the chart size, making it flat.

To avoid having to readjust the price chart, follow these steps:

  1. Open the indicator configuration window
  2. Scroll to the bottom of the window
  3. Uncheck the boxes in the “Line” column
  4. Double-click on the price chart
Price rescale

The price chart will readjust; you won’t need to repeat this action.

Indicator Configuration

The CandleSticks indicator is fully configurable. You can choose to display the CandleStick(s) of your choice, apply filters, set price target levels, and customize the display.

Accessing the Control Panel

To access the indicator’s control panel, click on the indicator tab at the top of the price chart window, then click “Configure“:

CandleSticks Setting Panel Access

The control window will open and allow you to configure the indicator as desired:

CandleSticks Prorealtime Indicator Settings

Candlestick Selection

The CandleSticks indicator recognizes the thirty main candlestick patterns:

You can select the candlesticks of your choice by checking the corresponding boxes:

CandleSticks Selector

Trend Filters

The indicator contains two trend filters, allowing you to display candlesticks appearing in the trend or counter-trend:

  • Click the “in the Trend” option to display patterns within the trend.
  • Click the “Reversal” option to display patterns against the trend.
CandleSticks Trend Filters

Volume Filter

You can filter breakout signals only if volumes accompany them. To do this, click on the “with Volumes” option:

CandleSticks Volume Filter

Strength Filter

You can filter breakout signals only if they occur with strength. To do this, click on the “with Strength” option:

CandleSticks Strength Filter

Price Target and Safety Stop Loss

The indicator automatically calculates price target and safety stop loss levels based on the technical configuration:

  • You can display these levels by checking the “Take Profit” and “Stop Loss” boxes.
  • You can adjust these levels with the “TP Level” and “SL Level” parameters.
CandleSticks Target Stoploss

Display Configuration

The indicator allows you to configure the display of candlesticks, signals, and price targets.

CandleSticks Display Options

Here is what the indicator display options mean:

Display OptionsDefinitions
Colour (Long)Frame color for candlesticks and signals for long positions.
Color for price targets for long and short positions.
Colour (Short)Frame color for candlesticks and signals for short positions.
Price target colors for long and short positions.
Display SignalsDisplays buy and sell signals with an arrow.
Frame CandleSticksFrames detected candlesticks.
Display CandleSticks NameFrames detected candlesticks.

Creating an Alert System

The Prorealtime platform allows you to create trading alerts. You can use the CandleSticks indicator to create alerts for the occurrence of candlestick patterns.

Here are the steps you need to follow to create an alert:

1. Configure the Indicator

Before creating an alert, you must configure the CandleSticks indicator. The Prorealtime platform will use your indicator’s configuration to send you alerts. If you have selected the Green Hammer pattern with volume, alerts will only be sent for this configuration.

In this example, I will create an alert for the bullish engulfing pattern, accompanied by volume, appearing on the Nasdaq ETF (QQQ).

The first step is to open the indicator’s configuration panel, select the “Bullish Engulfing” pattern, and check the “with Volume” box:

Bullish Engulfing Alert Prorealtime Example

2. Open the Alerts Window

To set up an alert, you must open the alerts window. To do this, right-click on the price chart and click “Create New Alert“. This will open the following window:

Prorealtime Alert Window

3. Select the CandleSticks indicator

You must select the CandleSticks indicator so that the Prorealtime alert system uses the signals returned by this indicator:

CandleSticks Prorealtime Alert Indicator Selection

4. Set the values

The CandleSticks indicator returns 1 when a bullish pattern appears and -1 when a bearish pattern appears:

  • If you want to create an alert on bullish patterns, select the “equals” sign and enter a value of “1“.
  • If you want to create an alert on bearish patterns, select the “equals” sign and enter a value of “-1“.

This example involves creating an alert on a bullish pattern, so you need to set the value to 1:

CandleSticks Prorealtime Alert Signal Setting

5. Managing Triggers

The trigger section allows you to choose the alert timeframe. In this example, the platform will send alerts once a day in the event of a bullish signal:

CandleSticks Prorealtime Alert Properties

6. Creating the Alert

After checking your alert settings, click the “Create Alert” button:

CandleSticks Prorealtime Create Alert

Note: You can write a message describing the signal in the comment box.

7. Monitoring Alerts

You can find your alerts by opening the alerts window via “View“, “Alert Status“, or with the shortcut “CTRL-A“:

Prorealtime Alert Monitoring

Backtesting a Strategy

You can integrate the indicator into a backtest to test a configuration. To do this, you need to use the “CALL” function:

mySignal, myTargetLong, myStopLossLong, myTargetShort, myStopLossShort = CALL "CandleSticks"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 1, 1, 1, 0](close)

Calling the indicator in a backtest

To call the indicator in a backtest, you must pass its configuration parameters. I’ve created some sample code to help you integrate the indicator into a strategy. The variable names are the same as those of the indicator.

The following code calls the CandleSticks indicator. It will open long positions after the occurrence of the Greene Hammer pattern, accompanied by volume:

//--------------------------------------------------------//
// *** CandleSticks Backtest  *** //
//--------------------------------------------------------//
// Author: Vivien Schmitt
// Website: https://artificall.com
// Indicator: CandleSticks
// Description: https://artificall.com/candlesticks/
// Marketplace: https://market.prorealcode.com/product/candlesticks-indicator-screener/
//--------------------------------------------------------//

DEFPARAM CUMULATEORDERS = False
DEFPARAM PRELOADBARS = 1000

//--------------------------------------------------------//
// *** POSITION SIZE *** //
//--------------------------------------------------------//
// Capital to invest
ONCE CapitalToInvest = 10000
// Minimum number of contracts
ONCE NumberOfContractsMin = 1
// Position Size
NumberOfContracts = MAX(ROUND(CapitalToInvest / Close, 2), NumberOfContractsMin)

//--------------------------------------------------------//
// *** SETTING BLOCK *** //
//--------------------------------------------------------//
// * CandleSticks
ONCE  GreenHammer  = 1
ONCE  HangingMan  = 0
ONCE  InvertedHammer  = 0
ONCE  ShootingStar  = 0
ONCE  BullishSpinningTop  = 0
ONCE  BearishSpinningTop  = 0
ONCE  BullishMarubozu  = 0
ONCE  BearishMarubozu  = 0
ONCE  BullishEngulfing  = 0
ONCE  BearishEngulfing  = 0
ONCE  BullishHarami  = 0
ONCE  BearishHarami  = 0
ONCE  BullishHaramiCross  = 0
ONCE  BearishHaramiCross  = 0
ONCE  PiercingLine  = 0
ONCE  DarkCloudCover  = 0
ONCE  TweezerBottom  = 0
ONCE  TweezerTop  = 0
ONCE  MorningStar  = 0
ONCE  EveningStar  = 0
ONCE  BullishAbandonedBaby  = 0
ONCE  BearishAbandonedBaby  = 0
ONCE  ThreeWhiteSoldiers  = 0
ONCE  ThreeBlackCrows  = 0
ONCE  ThreeInsideUp  = 0
ONCE  ThreeInsideDown  = 0
ONCE  ThreeOutsideUp  = 0
ONCE  ThreeOutsideDown  = 0
ONCE  RisingThreeMethods  = 0
ONCE  FallingThreeMethods  = 0

// * Filters
ONCE  InTheTrend  = 0
ONCE  Reversal  = 0
ONCE  withVolume  = 1
ONCE  withStrength  = 0

// * Money Management
ONCE  TakeProfit  = 1
ONCE  TPLevel  = 3
ONCE  StopLoss  = 1
ONCE  SLLevel  = 1

// * Display Options
ONCE  ColourLong  = 0
ONCE  ColourShort  = 0
ONCE  DisplaySignal  = 0
ONCE  HighlightCandleSticks  = 0
ONCE  DisplayCandleSticks  = 0


//--------------------------------------------------------//
// * INDICATOR CALLING * //
//--------------------------------------------------------//
mySignal, myTargetLong, myStopLossLong, myTargetShort, myStopLossShort = CALL "CandleSticks"[GreenHammer, HangingMan, InvertedHammer, ShootingStar, BullishSpinningTop, BearishSpinningTop, BullishMarubozu, BearishMarubozu, BullishEngulfing, BearishEngulfing, BullishHarami, BearishHarami, BullishHaramiCross, BearishHaramiCross, PiercingLine, DarkCloudCover, TweezerBottom, TweezerTop, MorningStar, EveningStar, BullishAbandonedBaby, BearishAbandonedBaby, ThreeWhiteSoldiers, ThreeBlackCrows, ThreeInsideUp, ThreeInsideDown, ThreeOutsideUp, ThreeOutsideDown, RisingThreeMethods, FallingThreeMethods, InTheTrend, Reversal, withVolume, withStrength, TakeProfit, TPLevel, StopLoss, SLLevel, ColourLong, ColourShort, DisplaySignal, HighlightCandleSticks, DisplayCandleSticks](close)


//--------------------------------------------------------//
// * Buying Conditions * //
//--------------------------------------------------------//
IF NOT OnMarket AND mySignal = 1 THEN
  // Target price
  Set Target Price myTargetLong
  // Stop-Loss price
  Set Stop Price myStoplossLong
  // Buying order
  BUY NumberOfContracts CONTRACTS AT MARKET
ENDIF

//--------------------------------------------------------//
// * Short-selling conditions * //
//--------------------------------------------------------//
IF NOT OnMarket AND mySignal = -1 THEN
  // Target price
  Set Target Price myTargetShort
  // Stop-Loss price
  Set Stop Price myStoplossShort
  // Buying order
  SELLSHORT NumberOfContracts CONTRACTS AT MARKET
ENDIF

Backtest Results

Here are the results of this backtest applied to the Technology Select Sector SPDR ETF (XLK) in the daily time frame:

CandleStick Backtest Prorealtime

CandleSticks Screener

The CandleSticks market scanner will allow you to find candlestick patterns in real-time on the markets. You can apply it to predefined or custom lists and to any asset classes in all time frames.

Installing the Screener

The installation procedure for the screener is identical to that of the indicator. You will receive a license number specific to the screener you must add to your platform. After installation, you will find the screener in the ProScreener window of the Prorealtime platform.

To access the screener, follow these steps:

Open the ProScreener window

You can open the ProScreener window by clicking “View” then “ProScreener“, or by using the shortcut “Ctrl-E“:

ProScreener Open Window
Fenêtre ProScreener

Open the screener management window

Click the “Create or Edit a Screener” wrench in the ProScreener window:

ProScreener Create Modify CandleSticks Screener

Select the CandleSticks screener

Click the “CandleSticks Scan” screener located in the screener list:

ProScreener Select CandleSticks Screener

Screener Configuration

The screener settings are the same as those of the indicator, except for targets, stop-losses, and display options, which are not required for the scanner to operate:

Selecting Candlestick Patterns

You can select the candlestick(s) of your choice by checking the appropriate boxes:

CandleSticks Screener Candlestick Selections

Trend Filters

You can filter signals based on the trend:

CandleSticks Screener Trend Filters

Volume and Strength

You can filter signals based on volume and market strength:

CandleSticks Screener Volume Strength Filters

Timeframe and Asset List

The selection of time frames and asset lists is located in the “ProScreener Management” window.

Selecting the Time Frame

You can choose the time frame in which the screener will search for opportunities:

CandleSticks Screener Timeframe Setting

Selecting an Asset List

You must select a list in which you wish to search for opportunities:

CandleSticks Screener Asset List Setting

Launching the Screener

You can now launch the screener by clicking the “Run ProScreener” button:

CandleSticks Screener Running

Screener Results

After launching the screener, the discovered opportunities will appear in the results list. Click on a line to display it on the price chart:

CandleSticks Screener Result

Increase the Number of Opportunities

If the screener does not return a result, no stock matches your configuration. Here are some actions you can take to increase the number of opportunities found by the screener:

  • Select more candlesticks
  • Disable trend filters
  • Disable volume and strength filters
  • Choose large asset lists like the Nasdaq and NYSE
  • Choose a shorter timeframe

Share this Doc

CandleSticks Documentation [EN]

Or copy link

CONTENTS