Sat05182013

Last update12:00:00 AM

BackHomeS&C MagazineDepartmentsTraders' Tips TRADERSSTUDIO: SEPTEMBER 2012

TRADERSSTUDIO: SEPTEMBER 2012

logo

The TradersStudio code based on Vladimir Vladimirovich Voznjuk’s article, “Developing A Multilevel Strategy” is provided at the following websites (and is also shown below):

The following code files are provided in the download:

  • Function: “multiRangeDiff” for computing the author’s multilevel indicator values
  • System: “MULTI_JPY,” a system for trading the USD/JPY using EUR/USD as secondary datastream
  • Indicator plot: “MULTI_JPY_IND,” an indicator for plotting the multilevel indicator for the USDJPY/EURUSD
  • System: “MULTI_EUR,” a system for trading the EUR/USD using USD/JPY as secondary datastream
  • Indicator plot: “MULTI_EUR_IND,” an indicator for plotting the multilevel indicator for the EURUSD/USDJPY

I added an exit to the author’s suggested trading system that uses the multilevel indicator to exit. I then optimized the four parameters of the system and ran the backtest on both of the systems. The equity and underwater curves are shown in Figures 1 and 2. I used daily forex data from Pinnacle Data Systems for the tests. TradersStudio software is particularly well-suited for testing forex since it takes into account both the leverage of the account and the interest earned and charged on the overnight positions. In the backtest of the USD/JPY, there was net interest paid of $2,307 ($5,490 earned on the longs, $7,797 paid on the shorts). In the backtest of the EUR/USD, there was net interest $6,072 ($5,583 earned on the longs, $489 earned on the shorts). Both tests were run over the period 2/2/2001 to 7/13/2012 with leverage set to 25.

Image 1

FIGURE 1: TRADERSSTUDIO, USD/JPY. Here are equity and underwater curves for optimized combination trading USD/JPY from 2001 to 2012.

Image 2

FIGURE 2: TRADERSSTUDIO, EUR/USD. Here are equity and underwater curves for optimized combination trading EUR/USD from 2001 to 2012.

'DEVELOPING A MULTI-LEVEL STRATEGY
'Author: Vladimir Voznjuk, TASC Sept 2012
'Coded by: Richard Denning 7/16/2012
'www.TradersEdgeSystems.com
Function multiRangeDiff(momRange,indRange,sameDirection,scalingFactor,applyToMomSeries)
If applyToMomSeries = False Then
If sameDirection = True Then
multiRangeDiff = momRange + indRange*scalingFactor
Else
multiRangeDiff = momRange - indRange*scalingFactor
End If
Else
If sameDirection = True Then
multiRangeDiff = momRange*scalingFactor + indRange
Else
multiRangeDiff = momRange*scalingFactor - indRange
End If
End If
End Function
'-----------------------------------------------------------
Sub MULTI_JPY(scalingFactor,HighV,LowV,ExitLvl)
'defaults: scalingFactor=20,HighV=0,LowV=-0.8,ExitLvl=0
'mom series = USDJPY
'independent1 series = EURUSD
Dim momRange As BarArray
Dim indRange As BarArray
Dim multiRange As BarArray
Dim EURUSD_C As BarArray
Dim EURUSD_O As BarArray
EURUSD_C = C Of independent1
EURUSD_O = O Of independent1
momRange = C - O
indRange = EURUSD_C - EURUSD_O
'multiRangeDiff(momRange,indRange,sameDirection,scalingFactor,applyToMomSeries)
multiRange = multiRangeDiff(momRange,indRange,False,scalingFactor,False)
If multiRange > HighV Then Sell("SE",1,0,Market,Day)
If multiRange < ExitLvl Then ExitShort("SX","",1,0,Market,Day)
If multiRange < LowV Then Buy("LE",1,0,Market,Day)
If multiRange > ExitLvl Then ExitLong("LX","",1,0,Market,Day)
End Sub
'------------------------------------------------------------
Sub MULTI_JPY_IND(scalingFactor,upper,lower)
'defaults: scalingFactor=20,upper=0,lower=-0.8
'mom series = USDJPY
'independent1 series = EURUSD
Dim momRange As BarArray
Dim indRange As BarArray
Dim multiRange As BarArray
Dim EURUSD_C As BarArray
Dim EURUSD_O As BarArray
EURUSD_C = C Of independent1
EURUSD_O = O Of independent1
momRange = C - O
indRange = EURUSD_C - EURUSD_O
multiRange = multiRangeDiff(momRange,indRange,False,scalingFactor,False)
plot1(multiRange)
plot2(upper)
plot3(lower)
End Sub
'-------------------------------------------------------------
Sub MULTI_EUR(scalingFactor,HighV,LowV,ExitLvl)
'defaults: scalingFactor=50,HighV=0.3,LowV=0,ExitLvl=0.7
'mom series = EURUSD
'independent1 series = USDJPY
Dim momRange As BarArray
Dim indRange As BarArray
Dim multiRange As BarArray
Dim USDJPY_C As BarArray
Dim USDJPY_O As BarArray
USDJPY_C = C Of independent1
USDJPY_O = O Of independent1
momRange = C - O
indRange = USDJPY_C - USDJPY_O
'multiRangeDiff(momRange,indRange,sameDirection,scalingFactor,applyToMomSeries)
multiRange = multiRangeDiff(momRange,indRange,False,scalingFactor,True)
If multiRange > HighV Then Sell("SE",1,0,Market,Day)
If multiRange < ExitLvl Then ExitShort("SX","",1,0,Market,Day)
If multiRange < LowV Then Buy("LE",1,0,Market,Day)
If multiRange > ExitLvl Then ExitLong("LX","",1,0,Market,Day)
End Sub
'-------------------------------------------------------------
Sub MULTI_EUR_IND(scalingFactor,upper,lower)
'defaults: scalingFactor=50,upper=0.3,lower=0
'mom series = EURUSD
'independent1 series = USDJPY
Dim momRange As BarArray
Dim indRange As BarArray
Dim multiRange As BarArray
Dim USDJPY_C As BarArray
Dim USDJPY_O As BarArray
USDJPY_C = C Of independent1
USDJPY_O = O Of independent1
momRange = C - O
indRange = USDJPY_C - USDJPY_O
multiRange = multiRangeDiff(momRange,indRange,False,scalingFactor,True)
plot1(multiRange)
plot2(upper)
plot3(lower)
End Sub
'--------------------------------------------------------------

—Richard Denning
info@TradersEdgeSystems.com
for TradersStudio


To read the entire issue click here and subscribe today!

PTSK — The Professional Traders' Starter Kit
Home| Working Money Magazine | S&C Magazine | Traders.com Advantage | Online Store | Traders’ Resource
Add a Product to Traders’ Resource | Message Boards | Subscribe/Renew | Free Trial Issue | Article Code | Search

DEPARTMENTS: Advertising | Editorial | Circulation | Employment | Contact Us | BY PHONE: (206) 938-0570

Join us on Facebook     Follow us on Twitter     Follow Us on StockTwits

Bookmark and ShareCopyright © 1996-2013 Technical Analysis, Inc. All rights reserved. Read our disclaimer & privacy statement.

SUBSCRIBE TO OUR FREE
EMAIL NEWSLETTER!