Discussions
»
Product and Service Development
»
Formula Assistance
»
Workaround to enter a variable into Exploration formula
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 3/25/2005(UTC) Posts: 90 Location: London
|
Please can you help me. I developed a linear regression formula to detect an uptrend but when I came to run the exploration, I got an error message along the lines of "you can't enter a variable in a formula." I want the regression lines to continue with parallel support/resistance lines for variable bars, until a sharp price fall breaches the support line.
Have any experienced formula writers managed to produce a workaround to this? Your kindly advice would be much appreciated.
If this is impossible, can the SDK (software dev. kit) help?
|
|
|
|
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)
|
depending on whether tha value changes over time, or remains constant, you might get away with using LastValue(thevalue())
wabbit :D
P.S. Its easier to answer questions if you post your code too!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 3/25/2005(UTC) Posts: 90 Location: London
|
The variable is "time" it is not a constant. I'm trying to get the exploration to calculate and extend the Lin Reg lines bar by bar - in a similar way that a moving average average continually unfolds bar by bar.
|
|
|
|
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)
|
... but a simple moving average is just
Sum(C,prd)/prd
and the EMA is
pct=2/(1+prd);
(1-pct)*PREV + pct*C
Each unfolds bar by bar because each bar is calculated with the exception of the first prd bars.
If you post your code, or just the snippets where you are having trouble, it will be much easier to help you.
wabbit :D
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Workaround to enter a variable into Exploration formula
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.