Simple Graybox Technique: Colorizing Background

A simple but effective technique for building your first graybox is to colorize the background based on whether you should be looking for short or long trades and/or based on identification of specific setups. A key benefit over simply using traditional indicators is that it eliminates the effort and tedium required to process multiple indicators. This provides a real advantage especially for the very active trader. It eliminates the chart clutter and noise, as well.

In the example shown, I used some simple indicators to classify the market into 4 states and then colorize the background. The example code is for Ninjatrader 7. While still rudimentary at this stage, I do not share the ranking criteria. But, my process and goal was to find some indicators to help filter the market, in order, to help me focus on looking for long or short trades.

One particular aspect that I like about colorizing the background versus displaying buy and sell signals is that I found in the past that seeing buy and sell signals would often strongly bias my perception of the market, and seeing the signals made me less perceptive of the market and more likely to trade mechanically. In the example shown, we can have multiple degrees of confidence for long or short trades or different classifications of regimes.

if (rank ==2)
BackColorAll= Color.FromArgb(75,20,150,50);
if (rank ==1 )
BackColorAll= Color.FromArgb(75,20,250,50);
if (rank ==-1 )
BackColorAll= Color.FromArgb(75,250,50,50);
if (rank ==-2 )
BackColorAll= Color.FromArgb(75,150,100,100);

Example shown is for example purpose only. The settings are not calibrated for the chart shown.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s