Australian (ASX) Stock Market Forum

TradeSim

Hi guys.

A bit of a dilemma again.
the liquidity filter was rejected for some reason so i got rid of it.

Just use this:

Ent:= Cross( H, Ref( HHV( H, 10), -1)) AND H > Mov( C, 40, E ) AND HHVBars(H, 70) = 0
AND Mov( V * C, 21, S) > 500000 AND C > O AND C < 10.00;

and read in the manual what the Fml() function does ie: Fml("Liquidity")

WARNING! Trade price modified for trade XYZ on date 89-89-89 caused by Invalid Entry Price Data.

Not sure but what is Ent; for on the second line?

SB
 
Got a few questions:

1/ Does anybody know why my "open trade equity window" and "security chart window" on the top toolbar are greyed out?

(They've been this way ever since i installed tradesim.)

I'v posted this question on the tradesim forum as well -- no response as yet so i thought i'll try here.

2/ Right now, my initial stop is placed 3*ATR away from the CLOSE price which triggered the entry.
InitialStop:=Ref(C-3*ATR(10),-1);

How do i modify this so that i use my actual entry price to calculate the price? Its not entirely practical in real-life, but what i want to do in real-life is to get somebody to see the indicative price moments before the OPEN. The night before the 3*ATR in cents will already be calculated. Then when they see the indicative, they can plug that into the Stator position sizing page, and then work out how many shares to buy.

Would it be:
InitialStop:=EntryPrice-3*ATR(10)

The reason I want to do that is because sometimes in backtesting, some trades are rejected because the initial stop loss is greater than the opening price which is the entry price. This is entirely possible since the initial stop loss is calculated using the previous close data. So all you need is a nice couple of hundred points tumble on the DOW and the stock price may actually gap down on the open more than 3*ATRs.

Maybe Im rejecting a few winners here?

I dont know. But worth testing. And i see tech uses his stop as 10% of the PURCHASE price.

3/ Does the monte carlo profit stats include open equity or only closed equity?

Thanks guys.
 
Got a few questions:

1/ Does anybody know why my "open trade equity window" and "security chart window" on the top toolbar are greyed out?

(They've been this way ever since i installed tradesim.)

I'v posted this question on the tradesim forum as well -- no response as yet so i thought i'll try here.

You havent activated them.

2/ Right now, my initial stop is placed 3*ATR away from the CLOSE price which triggered the entry.
InitialStop:=Ref(C-3*ATR(10),-1);

How do i modify this so that i use my actual entry price to calculate the price? Its not entirely practical in real-life, but what i want to do in real-life is to get somebody to see the indicative price moments before the OPEN. The night before the 3*ATR in cents will already be calculated. Then when they see the indicative, they can plug that into the Stator position sizing page, and then work out how many shares to buy.

Would it be:
InitialStop:=EntryPrice-3*ATR(10)

Looks about right to me but i cant try it as I dont have tradesim here.

The reason I want to do that is because sometimes in backtesting, some trades are rejected because the initial stop loss is greater than the opening price which is the entry price. This is entirely possible since the initial stop loss is calculated using the previous close data. So all you need is a nice couple of hundred points tumble on the DOW and the stock price may actually gap down on the open more than 3*ATRs.

Maybe Im rejecting a few winners here?

Maybe but more than likely your keeping yourself out of a losing trade


3/ Does the monte carlo profit stats include open equity or only closed equity?

Thanks guys.

Closed.But ofcourse you are setting a date at which all will be sold.
So all will be closed.
I use open equity info to see how its performing during the life of the test.
the equity curve of open e is plotted against closed so you will see a "smoothness".Particularly in longerterm methods which take months to close positions.
 
You havent activated them.



Looks about right to me but i cant try it as I dont have tradesim here.



Maybe but more than likely your keeping yourself out of a losing trade




Closed.But ofcourse you are setting a date at which all will be sold.
So all will be closed.
I use open equity info to see how its performing during the life of the test.
the equity curve of open e is plotted against closed so you will see a "smoothness".Particularly in longerterm methods which take months to close positions.

Tech,
How do i activate them??

The system im testing now is a very long term system (average winner is 500days) so when running shorter term simulations, the closed equity curve doesnt look too flash!

As you would well know, you need time to build up a portfolio of winners and when running over 1-2 years, they havent run their full course yet so open equity would be helpfulhere.

And by the way, iv been going through all the archives in thechartist forum, as far back as she goes, and i thought this idea (by Zen) was GOLD:

Tech, I was referring from the transition from testing to actual trading, so this procedure only needs to occur once. Let's say you've got your final system and you want to start trading live on 1 October.

As you said above, if you just wait for the next x (where x=max no. open positions) NEW entry signals, it may take a while to build up your portfolio, plus get onto that one mega winner.

The other idea is to see what stocks your model is holding now assuming you started trading 5 years ago. Then you just buy all of these on 1 October, or perhaps only the ones in open profit.

The reason for this is that you have done your testing, and are comfortable with the annual return/drawdown figures. So with this strategy you are just "jumping on" your equity curve at a certain date.

But those winners in open profit if they are going in the right direction they should trigger another entry you would think.

Have you made use of that suggestion when starting trading any new system?

As for the disk, its on its way yeh?

Thanks
 
Hi guys.

Does anybody know how to view the Open Equity chart for weekly systems?

Seems to work fine on EOD systems, but weekly shows Error/Warning.

Any ideas would be much appreciated.
 
Hi Everyone.

Iv got a couple of questions regarding TradeSim again.

1/ If I want to set an ATR*type trailing exit for my weekly system, do I set the type of ATR to "Band" or "Trigger". This is explained in AN2 supporting documentation but i still cant understand it properly.

Period:=10;
ARC:=3;
Volatility:=ARC*ATR(Period);
ExitTrigger:=ExtFml( "TradeSim.TrailingStop",
TRIGGER,
LONG,
Volatility,
CLOSE,
LOW);

The above is how I have it set up now, but maybe im supposed to say "Band" instead of "Trigger" ??

2/ When using a trailing exit, how do i also use this for an Initial Stop for position sizing?

Do I just say InitialStop:=TrailingStop;

Thanks.

ANy help is much appreciated.
 
Im currently developing a weekly system, which has no initial stop.

The exit is an ATR-type trailing stop. (And yes I have read that little manual AN-2 about how to correctly set these up.)

Using Tradesim, how do i set the initial stop to the ATR-exit, so then i can test fixed risk position sizing models on the system?

The way i have it set up now is (only relevant sections shown):

ExitTrigger:=ExtFml( "TradeSim.TrailingStop",
TRIGGER,
LONG,
Volatility,
CLOSE,
LOW);

ExitPrice:=OPEN;

InitialStop:=0;

Any help or suggestions or ideas would be much appreciated.

Thanks,
Nizar.
 
Im currently developing a weekly system, which has no initial stop.

The exit is an ATR-type trailing stop. (And yes I have read that little manual AN-2 about how to correctly set these up.)

Using Tradesim, how do i set the initial stop to the ATR-exit, so then i can test fixed risk position sizing models on the system?

The way i have it set up now is (only relevant sections shown):

ExitTrigger:=ExtFml( "TradeSim.TrailingStop",
TRIGGER,
LONG,
Volatility,
CLOSE,
LOW);

ExitPrice:=OPEN;

InitialStop:=0;

Any help or suggestions or ideas would be much appreciated.

Thanks,
Nizar.


Problem solved here.
 
Another question guys:

I have put this line of code into my MS exploration:

ExtFml("Tradesim.GetSymbolLength")<=3;

But Im still getting trades with stocks that have more than 3 symbols.
eg. NWSLV and ERGG

Any ideas why?

Thanks,
Nizar.
 
Nizar.
I use that as a stand alone filter on my data base.
I just run it then save the database.
That way there are no symbols over 3 in it.

It should still filter in the process but if it doesnt you could try that.
 
Nizar.
I use that as a stand alone filter on my data base.
I just run it then save the database.
That way there are no symbols over 3 in it.

It should still filter in the process but if it doesnt you could try that.

Tech can you please elaborate.

So do an exploration as per a normal backtest but instead of putting the full code in column A, i put the GetSymbol code in the filter and then run explorations on whatever results i get???
 
Nizar,

ExtFml("Tradesim.GetSymbolLength")<=3;

I believe this code should be placed in the entry code section and not where you have it!

Ent:=ExtFml("Tradesim.GetSymbolLength")<=3 AND etc AND etc;
 
Nizar,



I believe this code should be placed in the entry code section and not where you have it!

Ent:=ExtFml("Tradesim.GetSymbolLength")<=3 AND etc AND etc;

Hi rnr.

Still didnt work.
Im still getting trades of stocks like BPCO, MTTPA and RUPDP appearing in the trade databse.
 
Hmmmm i dont know what happened here, but look what happens to the monte carlo stats when i put GetSymbol in the entry criteria instead of just in the body of the code.

(THIS SIMULATION USED GETSYMBOL IN THE BODY)

Normal

Simulation Summary
Simulation Date: 23/09/2007
Simulation Time: 8:37:23 AM
Simulation Duration: 286.52 seconds

Trade Parameters
Initial Capital: $45,000.00
Portfolio Limit: 100.00%
Maximum number of open positions: 100
Position Size Model: Fixed Percent Risk
Percentage of capital risked per trade: 1.50%
Position size limit: 100.00%
Portfolio Heat: 100.00%
Pyramid profits: Yes
Transaction cost (Trade Entry): $22.00
Transaction cost (Trade Exit): $22.00
Margin Requirement: 100.00%
Magnify Position Size(& Risk) according to Margin Req: No
Margin Requirement Daily Interest Rate (Long Trades): 0.0000%
Margin Requirement Yearly Interest Rate (Long Trades): 0.0000%
Margin Requirement Daily Interest Rate (Short Trades): 0.0000%
Margin Requirement Yearly Interest Rate (Short Trades): 0.0000%

Trade Preferences
Trading Instrument: Stocks
Break Even Trades: Process separately
Trade Position Type: Process all trades
Entry Order Type: Market Order
Exit Order Type: Market Order
Minimum Trade Size: $500.00
Accept Partial Trades: No
Volume Filter: Reject Trades if Position Size is greater than
10.00% of the maximum traded volume
Pyramid Trades: Yes
Favour Trade Pyramid: Yes
Start Pyramid at any level up to level: N/A
Maximum Pyramid Level Limited to: N/A
Maximum Pyramid Count Limited to: N/A

Simulation Stats
Number of trade simulations: 20000
Trades processed per simulation: 1265
Maximum Number of Trades Executed: 179
Average Number of Trades Executed: 158
Minimum Number of Trades Executed: 138
Standard Deviation: 5.21

Profit Stats
Maximum Profit: $421,785.64 (937.30%)
Average Profit: $206,605.81 (459.12%)
Minimum Profit: $105,442.93 (234.32%)
Standard Deviation: $34,823.52 (77.39%)
Probability of Profit: 100.00%
Probability of Loss: 0.00%


Percent Winning Trade Stats
Maximum percentage of winning trades: 62.58%
Average percentage of winning trades: 52.10%
Minimum percentage of winning trades: 41.62%
Standard Deviation: 2.64%

Percent Losing Trade Stats
Maximum percentage of losing trades: 58.38%
Average percentage of losing Trades: 47.90%
Minimum percentage of losing trades: 37.42%
Standard Deviation: 2.64%

Average Relative Dollar Drawdown Stats
Maximum of the Average Relative Dollar Drawdown: $2,503.85
Average of the Average Relative Dollar Drawdown: $1,119.33
Minimum of the Average Relative Dollar Drawdown: $584.95
Standard Deviation: $213.27

Average Relative Percent Drawdown Stats
Maximum of the Average Relative Percent Drawdown: 1.7230%
Average of the Average Relative Percent Drawdown: 0.9085%
Minimum of the Average Relative Percent Drawdown: 0.5263%
Standard Deviation: 0.1387%

Maximum Peak-to-Valley Dollar Drawdown Stats
Maximum Absolute Dollar Drawdown: $60,067.90
Average Absolute Dollar Drawdown: $16,956.65
Minimum Absolute Dollar Drawdown: $4,375.91
Standard Deviation: $6,799.79

Maximum Peak-to-Valley Percent Drawdown Stats
Maximum Absolute Percent Drawdown: 27.8473%
Average Absolute Percent Drawdown: 9.8650%
Minimum Absolute Percent Drawdown: 5.0345%
Standard Deviation: 2.2823%
 
(THIS SIMULATION USED THE GETSYMBOL CODE AS PART OF THE ENTRY TRIGGER)

Monte Carlo Report

Trade Database Filename
C:\TradeSimData\EE ORIGINAL 3-symbol.trb

Simulation Summary
Simulation Date: 30/09/2007
Simulation Time: 10:38:37 AM
Simulation Duration: 183.69 seconds

Trade Parameters
Initial Capital: $45,000.00
Portfolio Limit: 100.00%
Maximum number of open positions: 15
Position Size Model: Fixed Percent Risk
Percentage of capital risked per trade: 1.50%
Position size limit: 15.00%
Portfolio Heat: 20.00%
Pyramid profits: Yes
Transaction cost (Trade Entry): $22.00
Transaction cost (Trade Exit): $22.00
Margin Requirement: 100.00%
Magnify Position Size(& Risk) according to Margin Req: No
Margin Requirement Daily Interest Rate (Long Trades): 0.0000%
Margin Requirement Yearly Interest Rate (Long Trades): 0.0000%
Margin Requirement Daily Interest Rate (Short Trades): 0.0000%
Margin Requirement Yearly Interest Rate (Short Trades): 0.0000%

Trade Preferences
Trading Instrument: Stocks
Break Even Trades: Process separately
Trade Position Type: Process all trades
Entry Order Type: Market Order
Exit Order Type: Market Order
Minimum Trade Size: $500.00
Accept Partial Trades: No
Volume Filter: Reject Trades if Position Size is greater than
10.00% of the maximum traded volume
Pyramid Trades: Yes
Favour Trade Pyramid: Yes
Start Pyramid at any level up to level: N/A
Maximum Pyramid Level Limited to: N/A
Maximum Pyramid Count Limited to: N/A

Simulation Stats
Number of trade simulations: 20000
Trades processed per simulation: 692
Maximum Number of Trades Executed: 157
Average Number of Trades Executed: 139
Minimum Number of Trades Executed: 121
Standard Deviation: 4.71

Profit Stats
Maximum Profit: $523,520.27 (1163.38%)
Average Profit: $333,148.38 (740.33%)
Minimum Profit: $176,462.04 (392.14%)
Standard Deviation: $44,530.72 (98.96%)
Probability of Profit: 100.00%
Probability of Loss: 0.00%


Percent Winning Trade Stats
Maximum percentage of winning trades: 66.93%
Average percentage of winning trades: 56.48%
Minimum percentage of winning trades: 45.52%
Standard Deviation: 2.49%

Percent Losing Trade Stats
Maximum percentage of losing trades: 54.48%
Average percentage of losing Trades: 43.52%
Minimum percentage of losing trades: 33.07%
Standard Deviation: 2.49%

Average Relative Dollar Drawdown Stats
Maximum of the Average Relative Dollar Drawdown: $2,613.98
Average of the Average Relative Dollar Drawdown: $1,122.06
Minimum of the Average Relative Dollar Drawdown: $561.54
Standard Deviation: $196.74

Average Relative Percent Drawdown Stats
Maximum of the Average Relative Percent Drawdown: 1.2350%
Average of the Average Relative Percent Drawdown: 0.6966%
Minimum of the Average Relative Percent Drawdown: 0.4117%
Standard Deviation: 0.0890%

Maximum Peak-to-Valley Dollar Drawdown Stats
Maximum Absolute Dollar Drawdown: $46,175.79
Average Absolute Dollar Drawdown: $17,762.84
Minimum Absolute Dollar Drawdown: $4,478.50
Standard Deviation: $5,719.41

Maximum Peak-to-Valley Percent Drawdown Stats
Maximum Absolute Percent Drawdown: 14.7459%
Average Absolute Percent Drawdown: 6.8667%
Minimum Absolute Percent Drawdown: 3.0614%
Standard Deviation: 1.7641%
 
Iv just noticed that theres only 692 trades in the trade database.

With GetSymbolLength in the body, i was getting 1271 trades.

Any ideas guys???
 
Nizar.
I use that as a stand alone filter on my data base.
I just run it then save the database.
That way there are no symbols over 3 in it.

It should still filter in the process but if it doesnt you could try that.

Tech.
Why do we use
ExtFml("Tradesim.GetSymbolLength")<=3;

As opposed to
ExtFml("Tradesim.GetSymbolLength")=3;

Are there even 2 letter codes on the ASX?
 
By the way, thanks Tech.

Your idea worked a charm ;)

And as a bonus, theres only 2282 securities to go through now, as opposed to 3174, so explorations are much quicker :)
 
Hi rnr.

Still didnt work.
Im still getting trades of stocks like BPCO, MTTPA and RUPDP appearing in the trade databse.

Hi Nizar,

My apologies as I was thinking "Entry Filter" instead of "Exploration Filter".

When running a MetaStock exploration for TradeSim back-testing the code is in Column A and this instruction ExtFml("Tradesim.GetSymbolLength")<=3; should be placed in the filter section of the exploration.

If my memory serves me correctly the TS Manual suggests that if you have previously run the above exploration without applying the filter then you should delete the trade database (.trb) before regenerating the database after introducing the filter (refer Problems using TradeSim Plug-in).

Hopefully I did not waste too much of your time.

Regards,
rnr
 
Top