OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


[Random Quote] -

  Current location        Thread information  
OmniTrader Pro Resource Forum
OmniLanguage Frequently Asked Questions
How to Check for Crossovers
Last Activity 12/2/2008 10:19 AM
0 replies, 4250 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
Matthew Greenslet

Idol
2000252525
Posts: 2077

Joined: 2/27/2006

User Profile
 
Subject : How to Check for Crossovers
Posted : 10/8/2007 4:10 PM
Post #6855

Q: How can I check if two indicators cross each other?

A:

In order to check for crossovers you need to compare two values. You will check the prior values against the current values. If 1 bar back Level1 was below Level2 And todays value of Level1 is above Level2 then we have a crossover. You now have the logic for Level1 crossing above Level2. You can just reverse the comparison sign to check for Level1 crossing below Level2. All of our indicators you can reference prior bars by encompassing a look back in brackets.

If needed, please see the following FAQ for examples:
http://www.omnitrader.com/omnitrader/proforum/thread-view.asp?threadid=1288&posts=1

So if we had two EMAs, say a 10 period and a 40 period EMA, and we wanted to know when they cross over, the logic would look like this.

If EMA(10)[1] < EMA(40)[1] AND EMA(10) > EMA(40) then

'Add code here to preform when the 10 period EMA crosses
'to the upside of the 40

ElseIF EMA(10)[1] > EMA(40)[1] AND EMA(10) < EMA(40) then

'Add code here to preform when the 10 period EMA crosses
'to the downside of the 40

End IF



[Edited by Matthew Greenslet on 10/12/2007 10:22 AM]

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.