Translating EMA-values to ZN-values or visaversa - NinjaTrader Programming | futures io social day trading
futures io futures trading


Translating EMA-values to ZN-values or visaversa
Updated: Views / Replies:3,082 / 17
Created: by max-td Attachments:3

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 3  
 
Thread Tools Search this Thread
 

Translating EMA-values to ZN-values or visaversa

  #1 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

Translating EMA-values to ZN-values or visaversa

hi all,
ZN is seems to get trendy here in this area ;-)
but i realized that is has strange values and cant be used together with MAs in a strategy because of this. EMA values + ZN values are totaly different- ie. if you wanna code an ENTRY after the Bar closes Above / Below EMA 50 - thats not possible at the moment. i am looking looking for some ideas to manage this, maybe someone got a "translation-code" in his pocket yet ;-)
Thanks for infos
max-td

Reply With Quote
 
  #2 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

hi max,

what are ZN-values. I do not know. but i think mike has same problem.

perhaps 123'234 anstead 123.57578 then i can give method ...

best regards

wh

Reply With Quote
 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received


This code may be of use, it was provided by Roonius:

private string FormatZN(double price)
{
return String.Format("{0}'{1:000}", Math.Truncate(price), (price - Math.Truncate(price)) * 320);
}


The number "320" is the bond fraction or number of pips per point. ZN is 320.

Mike

Reply With Quote
 
  #4 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

private string whatisthat(double number)
{


//string s = "114.843750";

string s = Convert.ToString(number);
string[] numbers = s.split('.');

string zahler = "";
double dnenner = 0;

for(int i = 0; i < numbers.length; i++)
{
if(i == 0)
String zahler = numbers[i];

if(i == 1)
String tmp = numbers[i];

double dtmp = Double.Parse(tmp);
dnenner = dtmp/ 320;
}

string nenner = Convert.ToString(dnenner);

string val = zahler+"'"+nenner;

return val;
}

is not tested some bugs inside

Reply With Quote
 
  #5 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

hi - one more try - with your codeexamples i couldnt do anything - i am just a copy+paste coder.
But i know what i need
here is an example of my condition-idea - very simple stuff :

double ZNvalueclose = Close[0] ;
double ema33 = EMA (33) [0] ;

if ( ZNvalueclose < ema33 )

{ go short }

But now we konw the problem that ZN gives us (europeans espcialy ) some grazy numbers wich are not comparable with the EMA-values.

so i need a bit of math-magic to translate my ZNvalueclose into a normal valuedouble



double ZNvalueclose = Close[0] ;

double ZNvalueNORM = ZNvalueclose * magic-maths ;

double ema33 = EMA (33) [0] ;

if ( ZNvalueNORM < ema33 )

{ go short }

i always work with such doubles only - need no dataseries or other big things
please dont laugh - thats the way i code my things + it works + thats my goal

maybe someone got an idea

i saw this Math.Truncate-Method in mike psoting - but dont know what tish is / how to use it in my formular

max-td

Last edited by max-td; June 18th, 2009 at 01:08 PM.
Reply With Quote
 
  #6 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

ok -another step DONE !

protected override void OnBarUpdate()
{

double EMAprice = EMA(30)[0];

string emaTOznvalue = String.Format("{0}'{1:000}", Math.Truncate(EMAprice), (EMAprice - Math.Truncate(EMAprice)) * 320);


emaTOznvalue now gives out the EMA in ZN-format
ie like : 114°025

next step is converting this string to a double to be able to use it for conditions in indicators or strategys in combination with PA (price-action)
stay tuned ...

max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #7 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received


max-td View Post
ok -another step DONE !

protected override void OnBarUpdate()
{

double EMAprice = EMA(30)[0];

string emaTOznvalue = String.Format("{0}'{1:000}", Math.Truncate(EMAprice), (EMAprice - Math.Truncate(EMAprice)) * 320);


emaTOznvalue now gives out the EMA in ZN-format
ie like : 114°025

next step is converting this string to a double to be able to use it for conditions in indicators or strategys in combination with PA (price-action)
stay tuned ...

Nice work max!

Mike

Reply With Quote
 
  #8 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

you need a string format, that can you parse to a double.
or you use the replace function in c# and then do parsing ...

string s = "114°025";

string v = s.Replace("°", ".");

double z = Convert.ToDouble(v);

You need a dot that you get a good double value ...

Reply With Quote
 
  #9 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

Thats what i have - a propper sting with this ` - thing.
You see the output in the text-box.

max-td
Attached Thumbnails
Translating EMA-values to ZN-values or visaversa-zn-ema.png  
Attached Files
Register to download File Type: cs ZN_EMA_01.cs (6.1 KB, 18 views)
Reply With Quote
 
  #10 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


oh - you think i have to replace that " ` " + make it a dot !?

max-td
Reply With Quote

Reply



futures io > > > > > Translating EMA-values to ZN-values or visaversa

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing input values kiasom EasyLanguage Programming 2 August 30th, 2011 02:27 PM
I'm trying to print the values from an ArrayList kaywai NinjaTrader Programming 13 May 13th, 2011 10:33 AM
Limit Values to Even Numbers Only DavidHP NinjaTrader Programming 9 October 10th, 2010 05:40 PM
Wavelets values max-td The Elite Circle 39 September 25th, 2010 07:53 AM
Referencing values in another indicator or Saroj NinjaTrader Programming 0 September 5th, 2009 12:02 AM


All times are GMT -4. The time now is 02:51 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-12 in 0.12 seconds with 20 queries on phoenix via your IP 54.90.207.75