OmniTrader Forum - OmniTrader 2020 Technical Support
Omniscript Stop with $SPX

^ Top
gottfried

Posts: 103

Joined: 12/17/2003
Location: Biel/Bienne Switzerland

User Profile
 
Subject : Omniscript Stop with $SPX
Posted : 9/15/2020 7:56 AM
Post #47505

I would like to make a stop on a stock symbol when a condition in $SPX is reached.
For instance sell all when Price ($SPX) is crossed lower then MA20.
How can I tell the system this stop is only for the index $SPX.

I would like to sell the position when the overall situation changes
^ Top
Jim Dean

Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscript Stop with $SPX
Posted : 9/15/2020 8:47 AM
Post #47507 - In reply to #47505

If you are trying to exit a trade on some other symbol than $SPX, then in OLang, you assign a variable to GetClose(“$SPX”), and use that variable in your calcs for the stop conditions, in place of Close. (Similar GetHigh, GetLow, GetOpen, GetVolume).

Most native OT functions allow “overloading” the param list so you can spec the use of any variable rather than the default C. To see this, in the OLang editor, type the name of the function and open paren … a help popup will appear, usually with more than one option, showing the param’s the function uses.

If you don’t have OT Pro, then you can do this in OScript as well without assigning a variable - just write out the GetClose(…) expression longhand.


https://www.omnitrader.com/currentclients/otforum/thread-view.asp?threadid=16303&posts=2