lineA= 53.47
Close= 53.47
If Close < LineA then
Sell next bar at market;
Position is responding as if code had <= in it and is getting closed. Both Commentary and Data Window give the price and indicator as 53.47. I'd like to to get more precision on LineA by increasing decimal places from 2 to 3 or 4. I'm playing around with it but could use an example as no luck so far. Here is a simple function code that is putting out 2 decimal places. How would one go about getting 4 decimal places out of this?
inputs:
PriceValue( numericseries ),
Len( numericsimple ) ;
AverageFC = SummationFC( PriceValue, Len ) / Len ;
Thanks.
Rounding problem?
-
- Posts: 53
- Joined: 04 Jan 2008
- Has thanked: 21 times
- Been thanked: 3 times
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Rounding problem?
Rick,
you can either print the values to the output and add the required decimal spaces as described here:
https://www.multicharts.com/trading-sof ... .php/Print
Or you can change the number of decimals a plot will show on a chart. You'll find the setting under General (No. of digits after the decimal) on the "Scaling" tab of the Format Study dialog for the particular study.
Regards,
ABC
you can either print the values to the output and add the required decimal spaces as described here:
https://www.multicharts.com/trading-sof ... .php/Print
Or you can change the number of decimals a plot will show on a chart. You'll find the setting under General (No. of digits after the decimal) on the "Scaling" tab of the Format Study dialog for the particular study.
Regards,
ABC
-
- Posts: 53
- Joined: 04 Jan 2008
- Has thanked: 21 times
- Been thanked: 3 times
Re: Rounding problem?
Thanks for taking the time ABC, I don't think this is going to solve my problem though. I've got to have the increased decimal output available to the "Strategy". I can't get the function to assign 4 decimal places to a variable and then view its output in Commentary as 4 decimal places. No problem seeing it in a indicator or data box.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Rounding problem?
MultiCharts uses Double Precision.
That means MultiCharts is doing your calculations internally using 15 decimal places.
(unless you specified the variable is an integer)
That means MultiCharts is doing your calculations internally using 15 decimal places.
(unless you specified the variable is an integer)