Error with entry condition
Author: maninjapan
Creation Date: 12/21/2009 11:46 AM
profile picture

maninjapan

#1
Im trying to get this entry to work, if the close of the spread is above the upper Standard Deviation, but its giving me an error on the entry condition.. I was trying to copy off the pairs trading strategy, but not having any luck...

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Seems like the "if (IsLastPositionActive) else..." block is flawed - missing "else".
profile picture

maninjapan

#3
That part came straight from pairs trading, the problems seems to lie in the fact that both of them are both data series and I'm using a '>' there... does that help? Error CS0019.

In the original paits trading it uses the following condition
CODE:
Please log in to see this code.


profile picture

Eugene

#4
Oh, that. For sure it's incorrect.

See The Bars Object > OHLC/V Series > How to: Access a OHLC/V value in the WealthScript Guide.

Conceptually it's the same as in previous versions you're used to, just the syntax is a little bit new.
profile picture

maninjapan

#5
Thanks Eugene, compiled fine after applying the follwing adjustment

CODE:
Please log in to see this code.


This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).