Chart of the Week

Posted in Footprint® Chart by tharnett on February 25, 2011

It just had to be crude oil. With so much news and geopolitical maneuvering we felt it only appropriate to give crude oil some more attention. There where numerable possible trades we could of focused in on, but this one really jumped out since it highlights a couple key points.

      - Potential highly rewarding trade location.
      - Potential for a momentum reversal in a very momentum driven market.
      - Showcases information only the Footprint chart can provide.

The bottom screenshot shows the Bid Ask Footprint chart. The beauty of this view is that it shows how bad the trapped buyers are stuck at the high. Yeah, of course price could have popped and taken out the high on the retest, but the fact it is didn’t. Armed with this information you have the transparency that very few people do and transparency provides confidence to do the right thing.

It is this type of buying on the highs or selling on the lows that can produce a very nice pullback from that level, which aggressive scalpers can take advantage of. These two trades both had at least $0.50 ($500) pullbacks on 1 contract!

Have you ever wondered when you go for the breakout trade and the market sometimes moves quickly against your position why this happens? This shows why…and traders using the Footprint know what to do.

Auction Market Theory Chart – RTL Discussion

Posted in RTL by astoeckley on February 23, 2011

A few weeks ago, we unveiled an exciting chart that helps anyone understand the auction process during the trading session. We’ve been pleased with all the great feedback on this chart and are happy that many users are making it one of their main charts. Click here to see that chart and download a definition. The chart is free for anyone to use, provided you subscribe to a Professional version of MarketDelta, which makes these RTL indicators viewable. You do not need to understand RTL yourself to use this chart.

We’ve had some requests to explain how the RTL was crafted to make this chart possible. As promised in our previous article for this chart, today I summarize the code that creates these signals.

This article is best for those already familiar with the RTL interface. I provide here a basic overview of these signals. You can look at the chart’s signals yourself to best understand the whole architecture and the details. If you are brand new to RTL and want to know the basics of creating signals and indicators, please see our RTL Support page, which includes links to many tutorials for RTL.

Included Indicators and Signals

If you double-click the chart, you will see a list of all the elements in this chart, including the RTL indicators and signals:

The 8 signals starting with “amt_” are those that indicate the “Responsive Buying,” “Initiative Selling,” etc. There are 8 of these because the chart is basically divided into 4 quadrants, and each quadrant can have 2 signal possibilities: buying or selling. The 4 quadrants are the areas above and below the previous day value area, and the same areas for the current day value area.

Additionally, there are two signals starting with “once_” that indicate the range extension that may occur during the day: either range extension up or range extension down.

The final three signals, two for “sessionstart” and one called “time_devstudy” simply look at the time of day and use this to plot relevant information on the screen. These create the chart notations “Session Start,” “Studying Previous Day Value Area” and “Studying Developing Value.”

The chart also contains a hidden pane, which has a simple, single custom indicator:

Finally, while not referenced in this element list, because it is not added directly to the chart, there is a custom signal, “time1100,”  included in some of the other signals:

Key Technique: This signal and others that provide once-per-session annotations use the same principle mentioned in this article from our Initial Balance blog series for limiting the frequency of signals.

The Basics

This “time1100″ signal simply consists of this:

After the market is open 90 minutes, it signals, and in this case, the signal marker creates the notation “Studying Developing Value” :

(The included indicator was originally named time1100 since in the Eastern Time Zone, 90 minutes after session start is 11 a.m.)

The “sessionstart” indicators use a different setting for the POS token which is only true once, and thus does not require signal limiting like the “time_devstudy”:

The hidden custom indicator, “BarDeltaCI,” has the following simple code:

This code is necessary for the “amt_” signal markers to include the net buying and selling activity as a reported number next to the signals’ text annotations. The VPS token here is simply set to find the net delta of the entire bar. You could also use the VB token instead.

Because signal markers can annotate the results of custom indicators only, and not standard indicators, this custom indicator is hidden and pulled into the “amt_” signals:

This is what allows us to see the numerical results in the signal itself:

The signals that determine if there is range extension look like this:

After the first hour, if the low of a bar drops below the lowest low of the first hour, we have negative range extension, and the signal marker for this signal notates this:

The positive range extension would be the flip side of this but basically the same code.

The Auction Market Theory Signals

The heart of the chart, of course, are the signals for auction activity. The code is similar for all these signals, but varies with respect to studying the previous day value area or the current day developing value. Here is the RTL for the morning session responsive selling above previous day value area:

The “tpo” token differentiates between VA High and Current VA High, which breaks the chart into the four quadrants mentioned earlier.

In plain English, this algorithm simply says:

If the price moves above the prior day’s value area high by 2 ticks or more, and the net delta (VB) is negative and it is during the first 90 minutes of the session, then create the signal.

This same formula is the same for all 7 other similar signals, just the specifics vary with respect to time of day, positive or negative VB and current or previous value area.

The signal marker then determines what to show on the chart when this happens, and this is where we pull in the custom indicator and flash the text annotation:

Finally, the presentation of the chart itself, with the Footprint data in front of a candle, is nothing more than a basic “overlay” chart. Click here for our introduction to overlay charts.

This should open your eyes to the relatively straightforward method of creating complex RTL setups. Usually, the individual signals are quite simple; it’s the combination of many separate simple elements that allow for creating a powerful interface.

BEGIN MarketDelta TRADING SIGNAL DEFINITION for time1100
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=time1100
BARCOUNT=AUTOMATIC
ELEM=TIME: Bar Time - hhmm.ss
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=POS > 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for time1100
BEGIN MarketDelta TRADING SIGNAL DEFINITION for time_devstudy
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=time_devstudy
BARCOUNT=AUTOMATIC
ELEM=signal_time:Scan/Signal:SIGNAL[ ] time1100,0 PREFS: 168,168,255,1,0,0,time1100,0,5,0,F,106660760,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,F,,F,F,F,2,895895,3,T,0,F,,1,F,T,
ELEM=SSTAT:Signal Statistics:SSTAT[ ] 20,time1100 PREFS: 0,0,255,1,0,0,time1100,0,9,F,F,3,255,0,0,1,0,0,106662816,20,0.000000,T,620620,2,1,
SIGNAL=signal_time=1 and SSTAT=1
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for time_devstudy
BEGIN MarketDelta TRADING SIGNAL DEFINITION for sessionstart
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=sessionstart
BARCOUNT=AUTOMATIC
ELEM=POS:Position Indicator:POS[ ] Result 1 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,1,6,744744,10,
SIGNAL=POS=1
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for sessionstart
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_respsellVAPrev
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_respsellVAPrev
BARCOUNT=AUTOMATIC
ELEM=HI:High
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=tpo_devhi:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,3,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=HI > (tpo_devhi+2*TINC) and VB <  0 and POS < 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_respsellVAPrev
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_respbuyVAPrev
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_respbuyVAPrev
BARCOUNT=AUTOMATIC
ELEM=LO:Low
ELEM=tpo_devlow:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,4,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=LO < (tpo_devlow-2*TINC) AND VB >  0 AND POS <= 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_respbuyVAPrev
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_initsellVAPrev
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_initsellVAPrev
BARCOUNT=AUTOMATIC
ELEM=LO:Low
ELEM=tpo_devlow:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,4,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=LO < (tpo_devlow-2*TINC) AND VB <  0 AND POS <=90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_initsellVAPrev
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_initbuyVAprev
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_initbuyVAprev
BARCOUNT=AUTOMATIC
ELEM=HI:High
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=tpo_devhi:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,3,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=HI > (tpo_devhi+2*TINC) AND VB >  0 AND POS <= 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_initbuyVAprev
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_initsellVA
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_initsellVA
BARCOUNT=AUTOMATIC
ELEM=LO:Low
ELEM=tpo_devlow:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,1,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=LO < (tpo_devlow-2*TINC) AND VB <  0 AND POS > 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_initsellVA
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_respbuyVA
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_respbuyVA
BARCOUNT=AUTOMATIC
ELEM=LO:Low
ELEM=tpo_devlow:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,1,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=LO < (tpo_devlow-2*TINC) AND VB >  0 AND POS > 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_respbuyVA
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_respsellVA
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_respsellVA
BARCOUNT=AUTOMATIC
ELEM=HI:High
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=tpo_devhi:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,0,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=HI > (tpo_devhi+2*TINC) and VB <  0 and POS > 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_respsellVA
BEGIN MarketDelta TRADING SIGNAL DEFINITION for amt_initbuyVA
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=amt_initbuyVA
BARCOUNT=AUTOMATIC
ELEM=HI:High
ELEM=VB:Volume Breakdown:VB[ ] PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,0,0,5,10,10001000,F,F,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,,,32767,0,0,
ELEM=TIME: Bar Time - hhmm.ss
ELEM=tpo_devhi:TPO Indicator:TPO[ ] PREFS: 0,0,0,0,0,0,157,157,255,2,2,0,176,176,255,1,2,1,255,174,174,2,2,0,255,204,204,1,2,1,0.250000,0,10011001,T,T,30,0,70.000000,F,F,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
ELEM=TINC:Tick Increment
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=HI > (tpo_devhi+2*TINC) AND VB >  0 AND POS > 90
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for amt_initbuyVA
BEGIN MarketDelta TRADING SIGNAL DEFINITION for extensionDown
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=extensionDown
BARCOUNT=AUTOMATIC
ELEM=TIME: Bar Time - hhmm.ss
ELEM=LO:Low
ELEM=SESST:Session Statistics Indicator:SESST[ ] Stat 1 PREFS: 255,0,0,1,2,0,0,128,0,1,0,0,1,4,60,6,10011001,0,1,0,5,F,F,1020,
ELEM=POS:Position Indicator:POS[ ] Result 5 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,5,6,744744,10,
SIGNAL=POS > 60 and LO < SESST
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for extensionDown
BEGIN MarketDelta TRADING SIGNAL DEFINITION for once_extensionDown
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=once_extensionDown
BARCOUNT=AUTOMATIC
ELEM=signal_extensionDown:Scan/Signal:SIGNAL[ ] extensionDown,0 PREFS: 0,0,0,0,0,0,extensionDown,0,0,0,F,106687488,0,0,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,F,,F,F,F,2,895895,0,F,0,F,,1,F,T,
ELEM=SSTAT:Signal Statistics:SSTAT[ ] 20,extensionDown PREFS: 0,0,255,1,0,0,extensionDown,0,9,F,F,3,255,0,0,1,0,0,106689544,20,0.000000,T,620620,2,1,
SIGNAL=signal_extensionDown = 1 and SSTAT = 1
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for once_extensionDown
BEGIN MarketDelta TRADING SIGNAL DEFINITION for extensionUp
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=extensionUp
BARCOUNT=AUTOMATIC
ELEM=TIME: Bar Time - hhmm.ss
ELEM=HI:High
ELEM=SESST:Session Statistics Indicator:SESST[ ] Stat 0 PREFS: 255,0,0,1,2,0,0,128,0,1,0,0,0,3,60,6,10011001,0,1,0,5,F,F,1020,
ELEM=POS:Position Indicator:POS[ ] Result 7 PREFS: 0,255,0,1,0,0,255,0,0,1,0,0,7,6,744744,10,
SIGNAL=POS > 60 and HI > SESST
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for extensionUp
BEGIN MarketDelta TRADING SIGNAL DEFINITION for once_extensionUp
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=once_extensionUp
BARCOUNT=AUTOMATIC
ELEM=signal_extensionUp:Scan/Signal:SIGNAL[ ] extensionUp,0 PREFS: 0,0,0,0,0,0,extensionUp,0,0,0,F,106693656,0,0,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,F,,F,F,F,2,895895,0,F,0,F,,1,F,T,
ELEM=SSTAT:Signal Statistics:SSTAT[ ] 20,extensionUp PREFS: 0,0,255,1,0,0,extensionUp,0,9,F,F,3,255,0,0,1,0,0,106695712,20,0.000000,T,620620,2,1,
SIGNAL=signal_extensionUp and SSTAT=1
- Comments
END MarketDelta TRADING SIGNAL DEFINITION for once_extensionUp
BEGIN MarketDelta CUSTOM INDICATOR DEFINITION for Bar_deltaCI
COMMENT=NONE
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9
DATAFEED=TransAct
NAME=Bar_deltaCI
BARCOUNT=AUTOMATIC
ELEM=VPS:Volume Price Statistics:VPS[ ] VUP PREFS: 0,0,255,1,0,0,0,0,255,1,0,0,6,15,921921,100,2,
INDICATOR=VPS
- Comments
END MarketDelta CUSTOM INDICATOR DEFINITION for Bar_deltaCI
BEGIN MarketDelta CHART DEFINITION for amt
COMMENT=Auction Market Theory Order Flow Analysis
SOURCE=DeBuG
PLATFORM=Windows 7 (6.1, Build 1DB0)
DATE=01/27/2011 14:19
VERSION=10.3.9 (Build #32815 Jan 25 2011 14:53:44)
DATAFEED=TransAct + DTNMA
NAME=amt SIZE=655,934
PERIODICITY=4,12500 (1.25 Range)
PIXELS=121:0
LOOKAHEAD=0
RMARGIN=0
CFLAGS=262144 CFLAGS2=154113
VIEWPERIOD=1,1,3,3378792600,3378982690 (Last 3 days)
COLORS=0,16777215,0,15724527,15263976,0,16777215,0
DESC=amt: ESH1 (1.25r), ESH1 (1.25r) 1.25 Range, Session 2
SESSION OVERRIDE=2 Index Options: Hours: 09:30 to 16:15
TICKER=ESH1:CME:31 SECTYPE=3 DISPLAY=12 ALIAS=@ES#
TICKER=ESH1:CME:31 SECTYPE=3 DISPLAY=12 ALIAS=@ES#
PANE #1 PCT=0.298906 PFLAGS=272 SCALE=1,-4800.000000,4500.000000,0.000000,0.000000,0.000000,0,0
PANE #2 PCT=0.998785 PFLAGS=33944 SCALE=65,1290.403583,1299.197701,0.250000,1.000000,17.000000,0,8
PRESET: TPO_1 ,#145 DESC: TPO[ ] LABEL: F RECALC: 1,1 PREFS: 0,0,0,0,0,0,192,192,192,2,2,0,0,0,0,3,2,0,192,192,192,2,2,0,255,255,255,1,2,1,0.250000,0,10011001,T,T,30,0,70.000000,F,T,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
INDICATOR: BUTN #94 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: BUTN: TPO_1  LABEL: F RECALC: 0,0 PREFS: 4,0,0,101951440,600600,,145,TPO_1 ,0,0,,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] time_devstudy,0 LABEL: F RECALC: 0,0 PREFS: 0,0,255,1,0,0,time_devstudy,0,5,3,F,106658704,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,Studying Developing Value (DVA),F,F,F,2,895895,3,F,60,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] sessionstart,0 LABEL: F RECALC: 0,0 PREFS: 0,0,255,1,0,0,sessionstart,0,5,3,F,106664872,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,Studying Previous Day Value Area (VA),F,T,T,1,895895,3,F,60,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] sessionstart,0 LABEL: F RECALC: 0,0 PREFS: 64,0,0,1,0,0,sessionstart,0,5,3,F,106666928,0,24,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,SESSION START,F,F,F,2,895895,3,F,30,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_respsellVAPrev,0 LABEL: F RECALC: 0,0 PREFS: 198,99,0,1,0,0,amt_respsellVAPrev,0,5,1,F,106668984,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,VA: Responsive Sells,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_respbuyVAPrev,0 LABEL: F RECALC: 0,0 PREFS: 0,128,0,1,0,0,amt_respbuyVAPrev,0,5,0,F,106671040,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,VA: Responsive Buys,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_initsellVAPrev,0 LABEL: F RECALC: 0,0 PREFS: 206,103,0,1,0,0,amt_initsellVAPrev,0,5,0,F,106673096,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,VA: Initiating Sells,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_initbuyVAprev,0 LABEL: F RECALC: 0,0 PREFS: 0,128,0,1,0,0,amt_initbuyVAprev,0,5,1,F,106675152,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,VA: Initiating Buys,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_initsellVA,0 LABEL: F RECALC: 0,0 PREFS: 255,0,0,1,0,0,amt_initsellVA,0,5,0,F,106677208,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,DVA: Initiative Selling,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_respbuyVA,0 LABEL: F RECALC: 0,0 PREFS: 168,168,255,1,0,0,amt_respbuyVA,0,5,0,F,106679264,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,DVA: Responsive Buying,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_respsellVA,0 LABEL: F RECALC: 0,0 PREFS: 255,0,0,1,0,0,amt_respsellVA,0,5,1,F,106681320,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,DVA: Responsive Selling,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] amt_initbuyVA,0 LABEL: F RECALC: 0,0 PREFS: 168,168,255,1,0,0,amt_initbuyVA,0,5,1,F,106683376,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,DVA: Initiative Buying,F,F,F,2,895895,5,T,50,F,Bar_deltaCI,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] once_extensionDown,0 LABEL: F RECALC: 0,0 PREFS: 255,128,0,1,0,0,once_extensionDown,0,5,3,F,106685432,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,NEGATIVE RANGE EXTENSION,F,F,T,1,895895,3,F,10,F,VAL,1,F,F,
INDICATOR: SIG #10 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: SIGNAL[ESH1 (1.25r)] once_extensionUp,0 LABEL: F RECALC: 0,0 PREFS: 0,128,0,1,0,0,once_extensionUp,0,5,3,F,106691600,0,16,,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0.000000,0.000000,0,0,0,0,0,0,0,0,0,T,POSITIVE RANGE EXTENSION,F,F,T,1,895895,3,F,0,F,VAL,1,F,F,
INSTRUMENT: ESH1:CME:2 PERIODICITY: 4,12500,1 TYPE: 24,2 COLORS: 37632,12255232,1,0 [Alias: @ES#]
FOOTPRINT: 1,13,8,0,9,0,0,0,0,0,0,3651,0,0,0.000000,0,0,0,0,0,,1,
SESSION #2. Index Options: Open,UnPosted, Hours: 09:30 to 16:15
INSTRUMENT: ESH1:CME:2 PERIODICITY: 4,12500,1 TYPE: 3,2 COLORS: 25600,16746632,1,0 [Alias: @ES#]
FOOTPRINT: 1,0,2,0,9,0,0,0,0,0,0,64,0,0,0.000000,0,0,0,0,0,,0,
SESSION #2. Index Options: Open,UnPosted, Hours: 09:30 to 16:15
INDICATOR: TPO #145 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: TPO[ESH1 (1.25r)] LABEL: F RECALC: 0,0 PREFS: 0,0,0,0,0,0,192,192,192,2,2,0,0,0,0,3,2,0,192,192,192,2,2,0,255,255,255,1,2,1,0.250000,0,10011001,T,T,30,0,70.000000,F,T,F,F,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
PANE #3 PCT=0.001631 PFLAGS=144 SCALE=1,-4800.000000,4500.000000,0.250000,1.000000,0.000000,0,0
INDICATOR: CI #40 ASSOC: ESH1:CME:2 PERIODICITY: 4,12500,1,FP,4,0,8,0,9,0,0,1,0,0, DESC: CI:Bar_deltaCI[ESH1 (1.25r)] VPS LABEL: F RECALC: 0,0 PREFS: 0,51,255,2,2,0,Bar_deltaCI,0,0,0,F,106697768,0,255,0,0,0,0,0,1,70.000000,F,0.000000,F,50.000000,F,F,10011001,1,0,0,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,
- This chart definition references 16 RTL objects (scan/signal/custom indicator)
END MarketDelta CHART DEFINITION for amt

“Initial Balance” Rotation Strategy: Part 6 – Profit Targets

Posted in RTL by astoeckley on February 16, 2011

(This is a continuation in our blog series on creating a trading system from start to finish. Want to see more? Click here for our main RTL support page, which links to all the articles in this series and many more tutorials. Questions? Click here for the RTL Community Forum where you can get help on your programming.)

In our previous article of this series, we introduced the backtesting engine in MarketDelta and completed a simple 250-day backtest of the strategy discussed so far. The results were quite decent, especially considering that the exit strategy we tested used simple end-of-day exits with no trade management.

Today we consider what effect new profit target rules will have on our system; we exit the trade after a 5-point profit target is met. We will look at many additional exit strategies in the coming weeks, so stay tuned.

Our previous backtest included 4 rules:

  1. The long entry
  2. The Short entry
  3. The end-of-day long exit
  4. The end-of-day short exit (called a “cover”)

When we add the profit target rules, we need to keep all these rules, because if the profit target is not met, we still need to exit at the end of the day.

We will add 2 new rules:

  1. Long exit after a 5-point profit
  2. Short cover exit after a 5-point profit

Profit target rules are quite simple, and they use the ENTRY token to determine the exit price.

Click the “New” button right above the Signal list to create each new signal.

Our long exit simply looks like this:

And the short exit is nearly the same, but uses “covershort” as the rule action:

The rules appear in the list, however, since each bar evaluates the rules from the top rule to the bottom rule, the ordering is important. We don’t want the end-of-bar rule to trigger and then another rule also trigger on the same bar at the end of the day. So make sure those two last-bar exit rules remain at the end of the list. Our six rules now show in the System window:

As we can see, this simple 5-point forced exit has increased our net profit significantly over the 250-day backtest period:

A sample trade, after adding the system to a chart:

Of course, adding this profit target means that we miss out on larger trades that could go more than 5 points; but we also gain winners from trades that made money but gave it up by the end of the day.

In the next article we will show how you add stop loss rules, and in the following article we introduce optimization so we can determine the best levels for both stops and targets.

Note: All backtesting examples are for illustrative purposes only and not a recommendation to trade these signals.

Starting to Learn the Order Flow Basics

Posted in Footprint® Chart, User Tips by tharnett on February 10, 2011

NOTE: This material is straight from our guide “Learning to Read the MarketDelta Footprint®. It can be downloaded for free here.

If the meaning of the phrase “order flow” is not clear to you, it should be by the end of this document. Order flow analysis is the missing link for many traders. It refers to how the orders are coming into the market, how they are being filled; whether executing at the offer or on the bid. It is the dual auction at the most micro-level. Assessing order flow in real time can tell the trader how trade is being facilitated in any direction, a key concept in auction market theory. The order flow patterns, as revealed by the Footprint® chart, that we’ll be looking at are NOT traditional price patterns. Rather, these are T&S patterns that you’ve probably never even realized existed. The T&S data simply moves too fast to comprehend, and then in a flash the data has scrolled by, out of site. The Footprint® patterns can be classified into three general categories: intra-Bar patterns, end of Bar patterns, Multi-Bar patterns.

These patterns rarely, if ever, mean anything in and of themselves. This is where the MarketDelta Footprint® diverges radically from traditional price pattern and/or indicator based analysis. No attempt is made to oversimplify or under-simplify. Nor is the Footprint® a red light / green light type “system”. Instead, the insight gleaned from a deep and experienced comprehension of the Footprint®, allows the trader to integrate this data along with current market context and sound market logic. For example,
auction market theory or any other viable analytic philosophy which affords the trader the ability to assign structure and thus meaning to what he/she observes, combined with the Footprint®, will provide decision support of the highest possible quality. The Footprint® is not more or less important than either of the other two elements just mentioned; it is equal.

In general, Market Profile®, support and resistance analysis, trend lines, and other macro-type big picture analysis provides the where to trade. The Footprint excels in showing when to trade because of the way it represents order flow and volume.

After first gaining a basic understanding of what a Footprint® chart is (which presumably you’ve already achieved) the next step is to gain some level of observational awareness. Avoid making preconceived conclusions. Avoid deciding, in advance, what something is going to mean. Instead, begin the process with simply learning how to pick out key elements of Footprint® structure. That’s what this document is all about. Once you have gained some facility with what the various elements of Footprint® structure are, then you can begin coming to conclusions regarding the meaning of the elements in various contexts. Also, you can begin to assemble the elements into patterns. In this way, you’ll start making your own rules, based on what is real, not what some tradition, some book, or some trading guru has told you; which may or may not be valid information. The Footprint® lets you come to your own conclusions, if you learn to see the Footprint® in an unbiased fashion.

Continue reading here.

“Initial Balance” Rotation Strategy: Part 5 – Backtesting 101

Posted in RTL by astoeckley on February 3, 2011

(This is a continuation in our blog series on creating a trading system from start to finish. Want to see more? Click here for our main RTL support page, which links to all the articles in this series and many more tutorials. Questions? Click here for the RTL Community Forum where you can get help on your programming.)

Backtesting is the process of taking a trading idea and applying it to historical price data for the purpose of testing the method’s long-term profitability. It is fairly straightforward to imagine a potentially rewarding trading strategy, but how do you build confidence that it works over time? Backtesting investigates how it would have performed if you had traded it every day over the course of a few months or years, whatever your preference.

Today we kickstart a multi-part series for backtesting in MarketDelta. We use as the strategy the 200% Initial Balance rotation pattern identified in Parts 1 thru 4 of this series. The RTL code used for the backtesting expands upon the custom indicators and signals already discussed in the earlier parts of this series. If you have not read these, see the “Case Study” on this page.

It is very important to outline some notable drawbacks to backtesting:

  1. Markets are constantly changing, and their flux alters volatility, participant’s attitudes and the way in which they behave. Backtesting cannot study the future; it focuses only on events that already occurred. A system that performed well in a previous year will not necessarily perform well in the following year. But backtesting does provide a meaningful clue on the overall success of a trading concept.
  2. Backtesting assumes that you traded your system rigidly, with great discipline, following the exact conditions of the trading rules without error or improvisation. In reality, discretionary traders rarely react this way, unless they strictly buy and sell from computer-generated signals.
  3. Market “slippage” prevents you from consistently entering or exiting at precisely the specific levels included in backtesting. You must consider this when studying the profit reports from a backtest. Real results, even if followed rigidly, are usually a bit different than a backtest suggests.

However, despite this caution, backtesting grows in popularity and can effectively contribute to your work — as long as you maintain this perspective.

Exit Signals

So far in this series, we have focused only on coding the trading signals that accurately determine when to enter a trade based on our strategy.

As we will see, a backtest is more involved with the exit signals. How you close a position has dramatic influence on whether the entry signal worked.

Consider the following ways you could exit a trade:

  1. Close the entire position at a specific profit target
  2. Close the entire position at a specific price level or event determined by a signal, regardless of the trade’s profit at that time
  3. Scale out, by closing parts of the position at different times, as it becomes more and more profitable
  4. Stop-loss: closing a position after a maximum loss threshold is reached
  5. Time target: close a position at a specific time (such as end-of-day)

Additionally, you may have multiple entries in combination with multiple exits.

In reality, most traders naturally do a combination of all these on every trade. This makes backtesting complicated. In this series, we will discuss all these scenarios.

Today, we look only at a very simple closing strategy: the end-of-day exit. This strategy is important for all future techniques as well; if a trade has not stopped out for a loss, but has also not met a profit target, you would likely still exit at the end of the day.

In today’s introduction to backtesting, we simply enter once and hold until the last minute of the trading session, and then exit. We will investigate what happens if you enter a short at the Double IB High or a long at the Double IB Low and hold it until the end of the day.

Create a Trading System

To start, use the RTL button, the File > New menu, or the Open > Trading System menu to open the Trading System window:

If you have not already, hit the New button to create a new system.

Create Backtest Entry Signals

We already created 2 trading signals in this blog series: the long and short signals at the Double IB High and Low. While these signals were good for charting, they need some modification for the system rules.

In backtesting, each signal typically involves more than just entry/exit criteria; it also sets variables used to manage the system’s actions.

Consider this RTL code for one of our signals:

LO <= (SESST_LOW  – (SESST_HIGH – SESST_LOW)) AND TIME >1030 AND TIME < 1500

(The times, 1030 and 1500 listed, are for Eastern. Adjust accordingly for your time zone.)

We want our backtest to presume that we entered right at this 2X IB Low, so the “Rule Price” for this action will be a user variable, V#1, that is set to be equal to the 2x IB Low. We set the user variable as part of the signal using the SET token. When you specify a specific entry price as we do here, the backtest will enter at, or nearest, this price on the signaling bar. You could choose other Rule Price options, such as the Close of the current bar, the Open of the next bar, or other variations. But by using SET and entering at the exact level then our backtest accurately emulates real-time trading behavior.

To set a variable, the syntax is as follows. We want to set variable V#1 to the value of the 2x IB Low.

SET(V#1,(SESST_LOW  – (SESST_HIGH – SESST_LOW)))

Now, we combine this with our existing signal, and we get:

SET(V#1,(SESST_LOW  – (SESST_HIGH – SESST_LOW))) AND LO <= (SESST_LOW  – (SESST_HIGH – SESST_LOW)) AND TIME >1030 AND TIME < 1500

However, there is no need to duplicate the math, so we can simplify this as:

SET(V#1,(SESST_LOW  – (SESST_HIGH – SESST_LOW))) AND LO <=V#1  AND TIME >1030 AND TIME < 1500

Note how the LO <= V#1 is a replacement for the full arithmetic, since this math is included in the SET statement.

Thus, the signal we use for the backtest is not the same as the signal we used in charting. Create this new signal for backtesting in one of two ways:

  1. If a similar chart signal already exists, find it in the signal list, double-click to open, then press Save As right away and give it a new name. Make your edits with the above SET statements and Save again.
  2. If creating the signal from scratch, press the New button next to Signal (not the New button at the top of the window, which is for starting a whole new system).

The signal will appear in the signal list after it is created.

Note: You can filter the signal list by typing the first few characters of signal names into the “Find” box below the Signal list. If you name all your signals for a system with the same prefix, such as IBx2_long, IBx2_short, etc, then you can filter for “IBx2″ and just see the signals you need for the current backtest project.

You will then need to create a similar signal for the Short side of this strategy.

Create a Trading Rule

Once the entry signals are in place, we create Actions for these signals. How many to buy? At what price?

Click once on an entry signal you created, in the signal list. Choose the appropriate Action from the column to the right. For short entry signals, do not choose “Sell” – rather, choose “Sell Short.”

Choose the number of contracts you plan to trade with this Action, and specify “Contracts” or “Shares.” Note: if your strategy is an all-in/all-out system, without multiple scale-outs, then the profit per-share (or per-contract) is going to be the same regardless of how many contracts you choose here. For today’s backtesting, enter any number you want, but make sure you use the same number for each entry and exit signal.

For the “Rule Price,” select V#1 since our signals will set this variable directly.

For Periodicity, choose “one minute.” Since it is easy to acquire several months, or even years of one-minute data, we recommend this for backtesting signals such as those used in this system. For most strategies, this is sufficient. If you use Tick data, you have limited access to how far back you can backtest since it is difficult to acquire vast amounts of Tick data. Additionally, the backtesting can take much longer as it much look at thousands of times the amount of data.

The “Rule Marker” and the “Intra-bar” check box do not apply to backtesting; these settings are for charting the rule after it is created. This optional step lets you verify where the rule would normally trigger. As we’ll see in a moment, you can do this more comprehensively by sending the entire trading system to the chart instead.

Press the Add Rule button and your new rule will appear in the Trading Rules list.

Do this again with the other entry signals in your system.

Create the Exit Rule

For backtesting purposes, we will have our strategy exit at the close of the last bar of the session.

First, click “New” above the signal list. Enter the following simple RTL code to specify the last bar of the day:

POS = 1

When you save this Signal under a desired name, it will prompt you for the POS token settings. Choose Bars from End of Session. This means that we exit 1 bar from the end of the day.

You only need one signal, even though we will create two exit rules from this same signal (one to exit the Long, another to exit the Short).

Create the long exit rule in the same way: click the new exit signal in the list, choose the number of contracts, and choose Sell. Use “Close” as the Rule Price, and select 1-minute Periodicity.

Repeat this process again for the short exit rule, using “Cover Short” as the Action. The program will offer a warning that you are adding the same signal more than once; this is fine.

When you are finished, you will see all the rules:

Click image for a larger view.

Trading Rules List Order

The order of the rules in your trading rules list can be very important. When the backtest runs, it studies each bar in succession, and evaluates all your trading rules in order, from the first rule to the last. If you have an Exit rule above an Entry rule, and the logic of your RTL code permits it, then it is possible for the system to generate an Exit followed by a new Entry all on the same bar, if they are in this order. If, however, you had the Entry above the Exit, this would not happen on a single bar.

In this system, both our entry signals and exit signals have a Time attached to them, thus the order of the rules for this case is arbitrary and makes no difference. But for more complex systems, it can be quite important, so keep this in mind.

Also, the system considers the current portfolio status of Long or Short when it studies each rule for each bar. If the system is Long at a particular point in time, it will ignore all entry signals and only look for a “Sell” signal that exits the Long position — or, if you have a BuyMore action, or a Reverse action, it will consult those as well. All Short signals or CoverShort rules are ignored while the position is Long.

Setup the Backtest

One the system is built, you have to tell the software how to perform the backtest. Press the Setup Backtest button:

Click to see a larger view.

An explanation of the numbered items in this window:

  1. You can backtest on a single symbol, or an entire quote page. For example, you could test against the entire Dow 30 stocks, allowing for multiple entries per day. Here, we are testing the E-Mini.
  2. If your strategy allows for multiple purchases throughout the session, you can specify the absolute max size of exposure. This does not apply to our current backtest.
  3. Commissions are a very significant part of trading results. There are two ways to approach commission costs in a backtest:
    1. Leave them at zero, and then subtract them yourself when you look at the “Average Profit Per Share” of the backtest report. If your average profit is $20 per contract, and your round-turn commission per contract is $5, then you know your actual profit results are $15 per contract. This is the easiest solution.
    2. If you wish to have the commissions automatically calculated into the backtest, you have to break it down in the following ways: Are you paying a flat rate for the trade, regardless of its size, or are you paying a per-share/per-contract commission? Are you paying a single commission for the entire round-trip, or do you pay a commission for both entry and exit? For futures traders, you typically pay a single round-turn commission for each contract. These Commissions fields are flat rate, unless you enter a comma. If you are not on a flat rate commission, your Entry is 0 plus a comma plus your per-contract fee. Then your Exit is also zero. So “0,5” would be a $5 commission per round-turn. Or you could enter “0,2.5″ for both Entry and Exit, to break it up equally.
  4. How far back do you want to test? You can specify an exact start and end date for the backtest, or go back a set number of days from the current day. You must have price data downloaded into MarketDelta for the time period you are studying. Use the Download button on the main MarketDelta toolbar and specify 1-minute data and as many days as you require.
  5. Our strategy depends on regular trading hours (RTH), so select Session 2. Remember, our exit is 1 bar from the close of the day, which would mean at 4:14 pm Eastern Time. You could optionally select Session 0 if you want to exit at 3:59 pm, when the stock market closes.
  6. Choose which backtest reports interest you. The “Average Profit Per Share” and “Total Net Profit” are on the Day by Day report. Where it says “Report Round Trips As”… This is important! Most day traders think of an entry and an exit as a single contract transaction. Choose “1″ if this applies to you. Otherwise, the report will show half your net profit per share, since it breaks it up between the entry and the exit.
  7. If you already ran a backtest and just want to see the reports again, click Display Latest Reports so you don’t have to wait for another backtest to complete (which can sometimes take a long time).

Press OK to save this Setup.

Run the Backtest

Finally, press the Backtest button to run the backtest.

When completed, the reports pop up. According to the Day by Day report, a 250-day backtest for Session 2 of this strategy reveals that a basic end-of-day exit for only 2 contracts yields $3070 of net profit when accounting for $5 round trip commissions:

The report shows a positive net profit, including commissions. Now, considering our strategy, it is fairly clear: markets are rotational indeed.

We will have much more to discuss on backtesting in coming articles.

Note: All backtesting examples are for illustrative purposes only and not a recommendation to trade these signals.

Visualize the Trades

Open any chart, and set it to the same session as your backtest. Then, in the backtesting window, press the Send to Chart button at the bottom. The TSYS indicator is added to the chart. It shows every trade in the backtest, when you entered and when you exited. Colors denote profits and losses during the trade:

Or, you can add the Trading System indicator to any chart you wish, and select your new system.