logo
Welcome Guest! To enable all features please Registers on the forum or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
BWPanda  
#1 Posted : Wednesday, December 1, 2010 6:15:34 AM(UTC)
BWPanda

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/1/2010(UTC)
Posts: 6
Location: NSW, Australia

I recently purchased MetaStock EOD 11 and have been setting up my indicators in the Exporer and EST.

I have just run my first EST simulation and found an issue with one of the results. I have a setup where 5 indicators need to be TRUE for a buy signal, then, once in the trade, 1 of 3 indicators need to be TRUE to exit.

For one of the shares I tested against, a buy signal was triggered at the correct time, but the corresponding sell wasn't triggered until 3 months after it should have been.

When looking at the Orders tab of the EST results I found out why - there are gaps in the results of about a month (i.e. there are buy signals being considered for a few days in a row, but then a gap in the dates, and more buy considerations a month later).
It was in one of these gaps that my sell should have been triggered, but because the EST seemingly didn't even look at these dates, it didn't see the signal.

I'm assuming it's something I've done wrong in my setup of the EST, and would be happy to post more information here, but am not sure on the policies regarding posting data or even how I can export my EST to show you...

Any assistance would be much appreciated!
wabbit  
#2 Posted : Wednesday, December 1, 2010 6:28:36 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Post the code and the ticker symbol.


wabbit [:D]

BWPanda  
#3 Posted : Wednesday, December 1, 2010 2:58:21 PM(UTC)
BWPanda

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/1/2010(UTC)
Posts: 6
Location: NSW, Australia

Hi Wabbit,

The ticker symbol is 'LNC.ASX' and my code is as follows:

Code:
Buy Order

---------

Alert(Cross(Mov(CLOSE, 2, E), Mov(CLOSE, 20, S)), 3)

AND

ROC(CLOSE, 90, $) > 0

AND

OscP(2, 15, S, %) > 0

AND

OscP(2, 15, S, %) > Ref(OscP(2, 15, S, %), -1)

AND

Mov(CLOSE, 20, S) >= Ref(Mov(CLOSE, 20, S), -1)

 
Sell Order

----------

CLOSE >= ValueWhen(1, Simulation.CurrentPositionAge = 0, OPEN) * 1.03

OR

OscP(2, 15, S, %) < Ref(OscP(2, 15, S, %), -1)

OR

CLOSE <= ValueWhen(1, Simulation.CurrentPositionAge = 0, OPEN) * 0.985

 
Sell Short Order

----------------

Alert(Cross(Mov(CLOSE, 20, S), Mov(CLOSE, 2, E)), 3)

AND

ROC(CLOSE, 90, $) < 0

AND

OscP(2, 15, S, %) < 0

AND

OscP(2, 15, S, %) < Ref(OscP(2, 15, S, %), -1)

AND

Mov(CLOSE, 20, S) <= Ref(Mov(CLOSE, 20, S), -1)

 
Buy To Cover Order

------------------

CLOSE <= ValueWhen(1, Simulation.CurrentPositionAge = 0, OPEN) * 0.97

OR

OscP(2, 15, S, %) > Ref(OscP(2, 15, S, %), -1)

OR

CLOSE >= ValueWhen(1, Simulation.CurrentPositionAge = 0, OPEN) * 1.015

BWPanda  
#4 Posted : Sunday, December 5, 2010 5:12:22 PM(UTC)
BWPanda

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/1/2010(UTC)
Posts: 6
Location: NSW, Australia

Anyone able to assist with this? Let me know if I need to provide any further information...
BWPanda  
#5 Posted : Monday, December 6, 2010 1:00:05 AM(UTC)
BWPanda

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/1/2010(UTC)
Posts: 6
Location: NSW, Australia

Here's a screenshot of the results from the EST, I've highlighted the missing dates.
wabbit  
#6 Posted : Monday, December 6, 2010 6:54:55 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
I don't see any problem -- there are no long or short entry signals in that period (according to my data).


wabbit [:D]




BWPanda  
#7 Posted : Monday, December 6, 2010 2:43:00 PM(UTC)
BWPanda

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/1/2010(UTC)
Posts: 6
Location: NSW, Australia

No buy signals, but at least one sell signal (see attached green circle).

When the Price Oscillator started rising again, it should have triggered my second sell signal (buy to cover order): OscP(2, 15, S, %) > Ref(OscP(2, 15, S, %), -1)

At the very least, my third sell signal should have been triggered when the price rose high enough that the close was greater than or equal to my buy price x 1.015 (around about the 8th July): CLOSE >= ValueWhen(1, Simulation.CurrentPositionAge = 0, OPEN) * 1.015

What I'd like to know is why neither of these were triggered... Is there something wrong with my code?
wabbit  
#8 Posted : Monday, December 6, 2010 6:59:06 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Buy to cover is the exit to a short trade; if you're not in a short position the code will do nothing.

Plot your trade entry conditions as an indicator and see where the signals are firing.



wabbit [:D]

BWPanda  
#9 Posted : Tuesday, December 7, 2010 2:51:01 AM(UTC)
BWPanda

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/1/2010(UTC)
Posts: 6
Location: NSW, Australia

Turns out my issue was in the use of "ValueWhen(1, Simulation.CurrentPositionAge = 0, OPEN)" to close orders. Once Wabbit showed me how to instead use the Stops tab of the EST, everything worked well.

Thanks Wabbit!
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.