Portfolio Analyzer: Example System
Prepare your trading system for Portfolio Analyzer
It’s necessary to prepare your trading system for Portfolio Analyzer.
Alterations of signal codes necessary for operating Real Time Portfolio Analyzer
For data export from strategies into RealTime Portfolio Analyzer in signal codes it is necessary to call function:
Value1 = TS_SetPortfolio(1,1,1);
Entry variables of TS_SetPortfolio function are the values set by user. For these values three positions are reserved. As entry variables it is possible to use Position Risk, Position Volatility, Position Assured Profit, in particular.
An example of using TS_SetPortfolio function is listed in a TS_Portfolio signal code.
Other parameters (Equity, NetProfit etc.) imported into RealTime PortfolioAnalyzer are fixed.
TS_SetPortfolio function receives data from each Trade Station strategy being launched and transfers it to RealTime PortfolioAnalyzer.
| EasyLanguage: | {******************************************************************* Name: TS_Portfolio Analysis Type: Strategy Description: Example Strategy for Portfolio Analyzer Used: tsprtfl.dll TS_SetPortfolio - function Provided By: Trade Smart Research (c) Copyright 2001 - 2004 www.tsresearchgroup.com *******************************************************************} Input:Moving(12); Var: Upper_Band(0),Down_Band(0), ExitLevel(0); Upper_Band = average(high,Moving){+average(high,Moving)*10}; Down_Band = average(low,Moving){-average(high,Moving)*10}; If High < Upper_Band then Sell Short Next Bar at Upper_Band Limit; If Low > Down_Band then Buy Next Bar at Down_Band Limit; If MarketPosition = 1 Then ExitLevel = Upper_Band; If MarketPosition = -1 Then ExitLevel = Down_Band; If MarketPosition = 0 Then ExitLevel = 0; {******************************************************************* Calling the functions Portfolio ********************************************************************} Vars: TS_PortfolioIn(0), Risk(0), TS_PosRisk(0), TS_PosVolatility(0), TS_AssuredPosProfit(0), HighestPosProfit(0); Risk = MarketPosition*(EntryPrice - ExitLevel)*CurrentContracts * BigPointValue; TS_AssuredPosProfit = - minlist(Risk, 0); HighestPosProfit = maxlist( OpenPositionProfit, HighestPosProfit); TS_PosRisk = Risk + HighestPosProfit; TS_PosVolatility = (AvgTrueRange(14)/Close)*100; TS_PortfolioIn = TS_SetPortfolio(TS_PosRisk,TS_PosVolatility,TS_AssuredPosProfit); {***** Copyright (c) 2001-2004 Trade Smart Research, Ltd. All rights reserved. www.tsresearchgroup.com ***** ***** Trade Smart Research reserves the right to modify or overwrite this analysis technique with each release. *****}
|
|