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.


  Current location        Thread information  
OmniTrader Professional Forum
OmniScripts
Help with long winded script
Last Activity 10/14/2018 9:04 PM
6 replies, 1270 viewings

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

^ Top
mitta

Veteran
10025
Posts: 131

Joined: 7/8/2009
Location: AUS

User Profile
 
Subject : Help with long winded script
Posted : 10/10/2013 5:45 AM
Post #22332

Hi all,

Am encountering a 'Syntax error, missing operand' error message when trying to save this long winded piece of code for a filter. Not sure what am doing wrong, but wondering if someone can spot an obvious error ..tia


Attached file : ST Filter.PNG (12KB - 231 downloads)

^ Top
Jim Dean

Sage
2000100010025
Posts: 3147

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Help with long winded script
Posted : 10/10/2013 5:54 AM
Post #22333 - In reply to #22332

Don't see an error - might show up if you provided it as a text string rather than a snapshot.

Way to find it:
Delete first half and try to save. If Ok, then prob is in 2nd half, else it is in first.
Repeat the halving, till you isolate the issue.

Keep an eye out for accidental use of tabs instead of spaces and zeros instead of capital Oh's
^ Top
mitta

Veteran
10025
Posts: 131

Joined: 7/8/2009
Location: AUS

User Profile
 
Subject : RE: Help with long winded script
Posted : 10/10/2013 6:04 AM
Post #22334 - In reply to #22332

Thanks Jim for such a quick response

Never thought of just breaking it down into small pieces to isolate the error

ta
^ Top
Jim Dean

Sage
2000100010025
Posts: 3147

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Help with long winded script
Posted : 10/10/2013 6:10 AM
Post #22335 - In reply to #22334

It's an old trick. Works for OLang code too, using debugmsg. Worth remembering, especially since error messages are not very detailed.
^ Top
mitta

Veteran
10025
Posts: 131

Joined: 7/8/2009
Location: AUS

User Profile
 
Subject : RE: Help with long winded script
Posted : 11/16/2013 7:52 PM
Post #22383 - In reply to #22335

Regarding the script in my previous post, which is just using simple O/C/H/L.

Is it possible within Omni script, to code for say, a lowish or highish 'close or open' of the candle/bar, an example of a lowish close and for that matter open, is indicated by bar #(1) in the attachment.

tia
Attached file : Example.png (3KB - 229 downloads)

^ Top
Jim Dean

Sage
2000100010025
Posts: 3147

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Help with long winded script
Posted : 11/16/2013 8:06 PM
Post #22384 - In reply to #22383

I'm sure it's possible but I'm not sure what you mean :-)

Do you mean you want to identify when the O&/orC is very near one end of the H/L range? Here's how to do that, if the nearness required is 10% of the H-L distance, and if you are trying to identify when C is near the L:
C-L < (H-L)/10
… and here, for the Open being near the H:
(H-O) < (H-L)/10

… or, both of them required to be near the L:
Math.max(C,O) - L < (H-L)/10
… or, both of them required to be near the H:
H-Math.min(C,O) < (H-L)/10

Other ways to do it but using math.xxx is most efficient.


^ Top
mitta

Veteran
10025
Posts: 131

Joined: 7/8/2009
Location: AUS

User Profile
 
Subject : RE: Help with long winded script
Posted : 11/16/2013 8:21 PM
Post #22385 - In reply to #22384

As always Jim, excellent response, exactly what was meant

Thank you kindly


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.