Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 4/18/2005(UTC) Posts: 25
|
Hi
I am trying to write simple clearly logical system test conditions using simulation 'variables' in them, but as soon as the value from a simulation function needs to be used as a data array it all goes bust.
Here is a specific example: Take any system and leave the entry logic, but now under the Sell Order write something like:
ABC := valueWhen(1, (Simulation.CurrentPositionAge = 1), Close);
C > (ABC + 20)
This does not seem to work, we're not exiting when the current Close goes above what the Close was when the deal was one bar old.
Now, if I write:
Simulation.CurrentPositionPointDifference > 20
That works!
I am trying to do more complex things than that, but the bottom line seems to be that whenever I derive a variable from a simulation function, that variable is not working properly as the data array on things like cross() or even simple logical checks.
Am I doing something wrong?
Thanks
Gerrit
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
Gerrit,
Can I ask why would you want to test a system that cannot be duplicated in an expert?
Simulation functions only work in the system test.
I want to test the system from an expert which I attach to the chart.
Signals and explorations are derived from Plain old fashioned Metastock Code.
When you attach the expert to a chart, if a newly formed signal occurs, it will appear on the chart on the last bar, and you will get an alert.
I would like to test my system on a group of stocks, so I can see it's profitability.
I'm more concerned about the win/loss ratio and the average win/average loss ratio
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 4/18/2005(UTC) Posts: 25
|
Hi Henry
What I am trying to do is build a little 'cashing' system and test my exit strategy. It is a simple idea, but I'm struggling to put it in a test, and yes I would love to have it in an expert advisor.
All I want to do is if the profit in the current position goes above 10, set my stop there, if it hovers and then continues above 20, my stop gets set to 20 and so on. For this I need either the current point difference or I need to duplicate my entire entry logic in the exit logic to know what price I entered the deal on.
Now hope fully you're going to tell me there's a very easy way to do this both in a system test and in an expert :)
Thanks
Gerrit
|
|
|
|
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.