|
Mario M
 Member
Posts: 9
Joined: 8/2/2004
User Profile |
Does anyone have a working example on how to implement the SymbolID function into OmniLanguage?
I get the symbol reference# but how is this applied to a formula?
Simple example: SymbolID("")=5425 SMA(10) > SMA(20)
How would this be written?
Thanks!
|
|
Barry Cohen
 Sage
      Posts: 6338
Joined: 1/19/2004
User Profile |
Good question! It depends on what you're after.
So 5425 is SPY & you're wanting the filter to pass all symbols only if the SMA(10) > SMA(20) on SPY is true? Or do you want the filter to pass if the symbol is SPY as well as the SMA(10) > SMA(20) is true?
This formula will pass any symbol if SPY's SMA(10) is greater than SPY's SMA(20).
SMA(GetClose("SPY"),10) > SMA(GetClose("SPY"),20)
That could also be written like this.

This formula will pass ONLY the SPY if SPY's SMA(10) is greater than SPY's SMA(20). All other symbols will not pass.
SymbolID("") = 5425 AND SMA(10) > SMA(20)
Attached file : SymbolID.png (13KB - 203 downloads)
|
|
Mario M
 Member
Posts: 9
Joined: 8/2/2004
User Profile |
Hey Barry,
Sorry for the delayed response.
What I am after is in omni language for a stop.
I use many references to $SPX in my formulas and am trying to write a stop referencing the stop value of the $SPX for the given symbol.
STOP EX: if SMA($SPX) > SMA($SPX)[1] then exit signal....
My formulas are complex but the syntax will(should) work regardless.
Thanks for the help!
|
|
Barry Cohen
 Sage
      Posts: 6338
Joined: 1/19/2004
User Profile |
STOP EX: if SMA($SPX) > SMA($SPX)[1] then exit signal.... |
In that case you would not use SymbolID. You could have an OmniScript stop set to a condition like this...
SMA(GetClose("$SPX"),10) > SMA(GetClose("$SPX"),20)
|
|
Mario M
 Member
Posts: 9
Joined: 8/2/2004
User Profile |
Thanks Barry for the help.
One of the indicators that I use out of the box is SuperTrend but I am having trouble writing this referencing $spx.
Tried many ways using your example with no luck.
Any ideas?
|
|
Barry Cohen
 Sage
      Posts: 6338
Joined: 1/19/2004
User Profile |
It looks like the SuperTrend indicators don't have a data parameter available like in the above example. I'll see if I can get it added in a pre-release.
|
|
Mario M
 Member
Posts: 9
Joined: 8/2/2004
User Profile |
I thought it was me.
Thanks!
|