Rank: Newbie
Groups: Registered, Registered Users Joined: 7/19/2005(UTC) Posts: 8
|
I am trying to write a simple system to evaluate Buy and Hold performance.
In the System Tester I have entered: Buy Order Tab: Cum(1)=1
In the Sell Order Tab: Cum(1)=LastValue(Cum(1))
When I run the system simulation, it returns a value that differs from the Buy and Hold performance on the simulation report.
Does anyone know what I am doing incorrectly?
Thanks, Greg :smt006
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Hi Greg,
That only returns a number of bars ... Try this
C-valuewhen(1,Cum(1)=1,C)
Patrick :mrgreen:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 7/19/2005(UTC) Posts: 8
|
Patrick,
Thank you for taking the time to help.
Do I enter that code into the Buy or Sell tab?
I entered it into the sell tab, ran the simulation, and still got different numbers.
Thanks, Greg
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
oh sorry I though you wanted an exploration ...
For the system tester use :
{Buy}
Cum(1)=1
{Sell}
Cum(1) = LastValue(cum(1))
Try this
Patrick :mrgreen:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 7/19/2005(UTC) Posts: 8
|
Patrick,
Thanks again.
What you listed is the code I started with. It always seems to return a higher value than the MS computation of Buy and Hold.
I can't figure out why. Thanks, Greg
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Quote:What you listed is the code I started with.
:lol: I'm tired I should go to bed ... :D
Hold on let me test something ... Make sure you run a points only test wiht no fancy options ...
Patrick :mrgreen:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 7/19/2005(UTC) Posts: 8
|
I made sure Points Only Test was selected and no comm or slippage or anything like that was selected.
I still got different profit numbers.
I don't want to take advantage of your generosity.
But I, like every other person on this board, REALLY appreciate your willingness to help. I feel bad about asking, but I have looked through the Code Primer as well as the User Manual; I can't figure it out.
Thank you for your help,
Greg =D>
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Wow it seems completely wrong ... :D
I will take a look at it but unfortunately I doubt I will have the answer before a while.
Patrick :mrgreen:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 7/19/2005(UTC) Posts: 8
|
Patrick,
Thanks for your help.
Greg
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Found it :D
Apparenlty the system tester does this calculation for buy and hold profit :
C-ValueWhen(1,cum(1)=1,O)
So it is using the first bar open value to start and not the close value.
Patrick :mrgreen:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 7/19/2005(UTC) Posts: 8
|
Does that mean that I should enter that code under the buy tab and leave the sell tab as we have it?
Greg
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
No that means you have to change your system tester settings to buy at open with 0 delays and sell at close with 0 delay.
Your original formula was fine .
Patrick :mrgreen:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 7/19/2005(UTC) Posts: 8
|
Patrick,
That works...Of Course!
Thank you so much for your effort.
Your a good guy! :smt041 :smt041 :smt041
Greg
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
No problem :D
Back to doing laundry now :cry: :lol:
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.