NeoTicker Forums  

Go Back   NeoTicker Forums > Trading Related > Indicator/Trading System Sharing
User Name
Password
Register FAQ Members List Calendar Mark Forums Read

Reply
 
Thread Tools Rating: Thread Rating: 25 votes, 5.00 average. Display Modes
  #1  
Old 08-09-2008, 08:04 PM
Charlescy Charlescy is offline
Regular User
 
Join Date: Aug 2006
Posts: 16
US Dollar Index

Good evening ,
I think The US Dollar Index is based on a 6 currencies basket.
Is it a way with some calculation/formula to get it in NeoTicker in Real Time,
once we have the "base" Currencies in real time.
I saw once a formula with some ^;I have no idea how to transfert ^ in an indicator.
Many thanks
Charles Cygler
Reply With Quote
  #2  
Old 08-12-2008, 01:05 PM
Bruce DeVault's Avatar
Bruce DeVault Bruce DeVault is offline
Regular User
 
Join Date: Jul 2006
Location: Washington DC
Posts: 8,829
If you mean how do you do ^ (the mathematical concept of exponent / power) in formula language, it's just ^ - for instance "5 * 3 ^ 2" -> "5 * 9" -> "45". If you're trying to translate a formula, you might want to post it in your example, or let us know where you're getting stuck.

To do this sort of thing, you could easily make a formula indicator with for instance 6 links, link it to 6 major currency pairs, and then refer to them as "data1", "data2" etc.
__________________
Bruce DeVault
bdevault@quantevo.com
www.quantevo.com
Reply With Quote
  #3  
Old 08-13-2008, 09:45 AM
Lawrence Chan Lawrence Chan is offline
Moderator
 
Join Date: Sep 2003
Posts: 2,358
In formula language, use power function.

e.g. 5^3 = power (5, 3) = 125
Reply With Quote
  #4  
Old 08-13-2008, 10:01 AM
Bruce DeVault's Avatar
Bruce DeVault Bruce DeVault is offline
Regular User
 
Join Date: Jul 2006
Location: Washington DC
Posts: 8,829
Lawrence, I am confused why you suggest using the power function here. The following code shows they're completely identical:

Code:
# NEOTICKER DATA BEGIN ScriptType=Indicator Description=FormulaPower Name=FormulaPower Language=Formula Links=1 MinBars=0 TimerInterval=100 EarlyBinding=0 MetaStyle=Normal ValueRange=Same as Source Placement=Smart Multiplot_num_plots=2 Multiplot_color_0=255 Multiplot_style_0=Line Multiplot_width_0=1 Multiplot_enabled_0=1 Multiplot_breakstyle_0=0 Multiplot_color_1=255 Multiplot_style_1=Line Multiplot_width_1=1 Multiplot_enabled_1=1 Multiplot_breakstyle_1=0 UpdateByTick=0 FloatMarker=1 DepthData=0 TradingSystemUI=0 PrimaryLinkOnly=0 NotifyOnRemoval=0 Param_count=0 Explanation_Lines=0 # NEOTICKER DATA END plot1 := 5 ^ 3; plot2 := power(5, 3);

Both plots always output 125. Is there some advantage to using the function instead of the operator that you're aware of?
__________________
Bruce DeVault
bdevault@quantevo.com
www.quantevo.com
Reply With Quote
  #5  
Old 08-13-2008, 11:05 AM
Lawrence Chan Lawrence Chan is offline
Moderator
 
Join Date: Sep 2003
Posts: 2,358
If you use brackets, then the priority of ^ is clear.

If you do not, then it is easier for beginners in writing formula to use power function for debugging purpose.
Reply With Quote
  #6  
Old 08-13-2008, 01:33 PM
Bruce DeVault's Avatar
Bruce DeVault Bruce DeVault is offline
Regular User
 
Join Date: Jul 2006
Location: Washington DC
Posts: 8,829
Alright, thanks for clarifying. It's important to remember that power takes precedence over things like multiplication or addition - that's something I take for granted but may not be obvious to everyone, whereas, as you point out, the function makes it completely obvious the order in which it's considered.
__________________
Bruce DeVault
bdevault@quantevo.com
www.quantevo.com
Reply With Quote
  #7  
Old 09-12-2008, 09:55 AM
Charlescy Charlescy is offline
Regular User
 
Join Date: Aug 2006
Posts: 16
Thank you

Many thanks for your answers,
I was a little bit absent seen my parents are ill;
I tried in formula 5^3 and it's fine;
Then 5^3^2 And it doesn't work;
Please could you tell me what to do?
My level in formulas is at the floor;
When I will replace those number by currencies to reach the index,
could you please explain me precisely what I should do.
Many thanks
Charles Cygler
Reply With Quote
  #8  
Old 09-13-2008, 07:05 AM
Bruce DeVault's Avatar
Bruce DeVault Bruce DeVault is offline
Regular User
 
Join Date: Jul 2006
Location: Washington DC
Posts: 8,829
Well, if you think about it, the order of precedence (the order you evaluate those two power operations) is unclear in what you wrote.

Specifically, there is a difference between (5^3)^2 and 5^(3^2). If you change it to either of those, it should work fine (see attached screenshot).

precedence.PNG
__________________
Bruce DeVault
bdevault@quantevo.com
www.quantevo.com
Reply With Quote
  #9  
Old 09-14-2008, 12:00 PM
cxk cxk is offline
Regular User
 
Join Date: Feb 2006
Posts: 26
and let's not miss the obvious. Depending on your datafeed, the index you are trying to recreate may be available directly.
__________________
cxk
Reply With Quote
  #10  
Old 01-20-2010, 03:52 AM
Iroquois Iroquois is offline
Registered User
 
Join Date: Jan 2010
Posts: 7
Hi, I was wondering similarily. Actually the USDX "formulae" is as follows :
USDX = 50.14348112 × EURUSD^(-0.576) × USDJPY^(0.136) × GBPUSD^(-0.119) × USDCAD^(0.091) × USDSEK^(0.042) × USDCHF^(0.036)

So I first thought of using the Weighted Index, but then I face two issues:
- apparently we can put numbers only as arguments in the parameter fields (so, no (power(5,3) nor (5^3))
- how do I multiply the whole thing with the first operand (50.14348112) ?

Thanks in advance. I'm currently reading through the manual, but I'm not done yet. Please feel free to redirect me to the right section if I missed it.
Reply With Quote
  #11  
Old 01-20-2010, 11:29 AM
Bruce DeVault's Avatar
Bruce DeVault Bruce DeVault is offline
Regular User
 
Join Date: Jul 2006
Location: Washington DC
Posts: 8,829
You can't do it just with weighted index, but it would be trivial to write in formula language as an indicator with 7 links and using the power function. The formula language tutorials teach how to make formula language indicators, and would be a great place to start.
__________________
Bruce DeVault
bdevault@quantevo.com
www.quantevo.com
Reply With Quote
  #12  
Old 01-20-2010, 12:26 PM
Support Team Support Team is offline
Administrator
 
Join Date: Feb 2006
Posts: 3,927
Help file section Formula Topic and Tutorials provide detail information on NeoTicker formula.

Additional formula examples and tutorials can be find on NeoTicker blog site: http://blog.neoticker.com
__________________
TickQuest Support
Reply With Quote
  #13  
Old 01-21-2010, 07:16 AM
Iroquois Iroquois is offline
Registered User
 
Join Date: Jan 2010
Posts: 7
Thanks ! That worked perfectly, although I'm sure what I've done so far could use a little bit of optimization And sorry for the double posting.
Reply With Quote
  #14  
Old 01-21-2010, 02:23 PM
Bruce DeVault's Avatar
Bruce DeVault Bruce DeVault is offline
Regular User
 
Join Date: Jul 2006
Location: Washington DC
Posts: 8,829
Not to worry - good luck to you.
__________________
Bruce DeVault
bdevault@quantevo.com
www.quantevo.com
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:31 AM.


Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
CopyrightŠ 2000-2010 TickQuest, Inc.