Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

SGN FUNCTION TRANSLATION Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
thecurve
Posted : Tuesday, August 12, 2008 10:35:27 AM
Registered User
Joined: 10/7/2004
Posts: 69
Bruce,

  You wrote this fx last time for a generic OBV xUP it's 10sma:

9 * SGN(C - C1) * V + 8 * SGN(C1 - C2) * V1 + 7 * SGN(C2 - C3) * V2 + 6 * SGN(C3 - C4) * V3 + 5 * SGN(C4 - C5) * V4 + 4 * SGN(C5 - C6) * V5 + 3 * SGN(C6 - C7) * V6 + 2 * SGN(C7 - C8) * V7 + SGN(C8 - C9) * V8 > 0 AND 9 * SGN(C1 - C2) * V1 + 8 * SGN(C2 - C3) * V2 + 7 * SGN(C3 - C4) * V3 + 6 * SGN(C4 - C5) * V4 + 5 * SGN(C5 - C6) * V5 + 4 * SGN(C6 - C7) * V6 + 3 * SGN(C7 - C8) * V7 + 2 * SGN(C8 - C9) * V8 + SGN(C9 - C10) * V9 <= 0

Is this the correct way to translate the SGN function:

SGN(C-C1) =  (((C-C1)/(C-C1)2).05)  i.e., (X / absX) ?  If not are you able to write a simplified fx re. SGN?
Thanks
SC
Bruce_L
Posted : Tuesday, August 12, 2008 10:47:22 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Your method will produce a division by zero error if C = C1, but that's the general idea - although I would probably adjust the parentheses somewhat:

(C-C1)/(((C-C1)2).5)

Without knowing the specific restrictions and having a complete list of the syntax of the program where you are using this, I cannot suggest what might be the best method (I'm assuming from the fact that you are squaring and then taking the square root that you don't have an ABS() function either).

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thecurve
Posted : Tuesday, August 12, 2008 12:01:27 PM
Registered User
Joined: 10/7/2004
Posts: 69
Hi Bruce,

    You're right the trading platform I use does not have an ABS fn.  I would be using the above syntax for the c/o of OBV (?- does the fx you wrote give the 10sma or 0 c/o?).
Thanks
Bruce_L
Posted : Tuesday, August 12, 2008 12:04:49 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
It is a cross of OBV up through its own Moving Average. OBV is a Cumulative Indicator and a crossup of zero would be meaningless.

Dealing with OBV & MS in PCF's - how to interp their "values"

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

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.