Floating point invalid operation? - MultiCharts | futures io social day trading
futures io futures trading


Floating point invalid operation?
Updated: Views / Replies:1,998 / 4
Created: by hughesfleming Attachments:0

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
 
Thread Tools Search this Thread
 

Floating point invalid operation?

  #1 (permalink)
Elite Member
Sliema+Sliema/Malta
 
Futures Experience: None
Platform: Multicharts, Proprietary
Broker/Data: IB,Barcharts.com
Favorite Futures: Stocks,Futures
 
Posts: 21 since Mar 2014
Thanks: 75 given, 12 received

Floating point invalid operation?

Hi,

I am trying to convert some code from mq4 to Easylanguage which uses a "better" Heiken Ashi close value. The following code gives me a floating point error and I am not sure why? It plots but when a new tick comes in it gives me the error. This is with RC 9.0

Thanks in advance,

Alex


 
Code
value1 = ((Open+Close) * 0.5) + ((Close-Open) / (High-Low)) * AbsValue((Close-Open) * 0.5);
Plot1 (value1,"BetterHaClose");

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

hughesfleming,

you will run into this error when the study attempts to divide by 0. In your case when High and Low are the same your code will try to divide by zero. This produces the error message.
You can overcome this by adding a check like this and a good practice would be to set an alternative result in case High = Low.
 
Code
if (High-Low) <> 0 then
value1 = ((Open+Close) * 0.5) + ((Close-Open) / (High-Low)) * AbsValue((Close-Open) * 0.5)
else
value1 = your alternative in here
Regards,
ABCTG


hughesfleming View Post
Hi,

I am trying to convert some code from mq4 to Easylanguage which uses a "better" Heiken Ashi close value. The following code gives me a floating point error and I am not sure why? It plots but when a new tick comes in it gives me the error. This is with RC 9.0

Thanks in advance,

Alex


 
Code
value1 = ((Open+Close) * 0.5) + ((Close-Open) / (High-Low)) * AbsValue((Close-Open) * 0.5);
Plot1 (value1,"BetterHaClose");


Reply With Quote
 
  #3 (permalink)
Elite Member
Sliema+Sliema/Malta
 
Futures Experience: None
Platform: Multicharts, Proprietary
Broker/Data: IB,Barcharts.com
Favorite Futures: Stocks,Futures
 
Posts: 21 since Mar 2014
Thanks: 75 given, 12 received


Super!

Kind regards,

Alex

Reply With Quote
 
  #4 (permalink)
Elite Member
Montreal
 
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: IB Canada/IQFeed
Favorite Futures: TF, CL
 
Posts: 261 since Jul 2011
Thanks: 288 given, 332 received

Floating point invalid operation

I'm getting the same error message with this code:

 
Code
inputs: Length( 14 ), XMA_Avg(14);
variables: BMP( 0 );
BMP =  ( Close - Open ) / ( High - Low );
Plot1( Average( BMP, Length ) ) ;
Plot2( XAverage(plot1, XMA_Avg));
Plot3(0);
How can I fix this? Thanks in advance.

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

olobay,

the solution is the same (your divisor is even the same, so you can use the same check) as described in #2 of this thread: https://futures.io/multicharts/33269-floating-point-invalid-operation.html#post435107

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:

Reply



futures io > > > > Floating point invalid operation?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
floating error johni MultiCharts 1 June 12th, 2012 11:43 PM
Invalid instrument Mondrakete NinjaTrader 9 June 17th, 2011 03:07 PM
IRT crosshairs and floating windows zury Investor/RT 11 May 16th, 2011 10:22 AM
Sierra Chart and DTN IQfeed bug (Invalid DTN Level 2 timestamp) Big Mike Sierra Chart 19 February 1st, 2011 03:00 PM
Can a floating window be coded with Ninjascript ? trendisyourfriend NinjaTrader Programming 29 December 21st, 2010 05:02 AM


All times are GMT -4. The time now is 08:45 PM.

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-16 in 0.09 seconds with 19 queries on phoenix via your IP 54.160.245.121