+1 888 340 6572
MultiCharts Project Management
previous_open_issue.png
Go to the previous open issue
previous_issue.png
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
bug_report_small.png
Open Bug report MC-1910

different results with ' / 1000; ' and ' * 0.001; ' applied to reserved word LastCalcMSTime

action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
next_issue.png
Go to the next issue (open or closed)
next_open_issue.png
Go to the next open issue
Description

Sometimes in the last bar of TICK, CONTRACT, POINT and CHANGE chart MC64 v9 returns different results in calculation of:
value1 = LastCalcMSTime * 0.001;
value2 = LastCalcMSTime / 1000;

I realized the issue after adapting the function LastBarOnChart_s to LastBarOnChart_ms.
(see code below)

Steps to reproduce this issue

vars: One3600th( Reciprocal( 3600 ) ),
LCTime_s.ms (0), //change integer 'LastCalcMSTime' to double 'LastCalcTime_s.ms'
Hrs (0), //hours since MidNight
Mns (0), //minutes since MidNight
Scs (0), //seconds since MidNight
mnsOpdHr (0), //minutes of current opened hour
scsOpdHr (0), //seconds of current opened hour
lastCalcHrs (0), //hours after midnight * 10000
lastCalcMin (0), //minutes of current opened hour * 100
lastCalcSec (0), //seconds of current opened hour
lastCalcMSec (0), //milliseconds from DateTime
lastTime_s.ms (0), //lastCalcTime_s.ms from reserved word 'LastCalcMSTime'
currMSecDT (0), //milliseconds from DateTime
currTime_s.ms (0), //current Time_s + currMSecDT
DateCondition(false),
TimeCondition(false);

//calculate last bar of chart Time_s.ms from reserved words 'LastCalcXXTime'

//LCTime_s.ms = LastCalcMSTime * 0.001;
LCTime_s.ms = LastCalcMSTime / 1000; //DO NOT USE '* 0.001' instead of '/1000'

Hrs = IntPortion( LCTime_s.msOne3600th );
Mns = 60
Hrs;
Scs = 60Mns;
lastCalcHrs = 10000
Mod(Hrs,24);
mnsOpdHr = LastCalcMMTime-Mns;
lastCalcMin = 100MnsOpdHr;
scsOpdHr = MnsOpdHr
60;
lastCalcSec = LastCalcSSTime - Scs - ScsOpdHr;
lastCalcMSec = FracPortion( LCTime_s.ms );
lastTime_s.ms = lastCalcHrs + lastCalcMin + lastCalcSec + lastCalcMSec;

//current realtime Time_s.ms

//currMSecDT = MillisecondsFromDateTime( DateTime ) * 0.001;
currMSecDT = MillisecondsFromDateTime( DateTime ) / 1000; //DO NOT USE ' * 0.001 ' instead of ' / 1000 '
currTime_s.ms = Time_s + currMSecDT;

//logic for LastBarOnChart_ms
DateCondition = ( Date = JulianToDate(LastCalcJDate) );
TimeCondition = ( currTime_s.ms = lastTime_s.ms );

LastBarOnChart_ms = ( DateCondition and TimeCondition );

Comments (1)
#1
user-offline.png  Alex MultiCharts (Alex MultiCharts)
Jun 14, 2017 - 08:51
We tried it on our end, but the issue was not reproduced. In case the issue persists, please send us export of the script with the workspace to support@multicharts.com
History
Issue basics
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (2)
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
  • Reproducability
    Not determined
  • Severity
    Critical
Attachments (0)
There is nothing attached to this issue
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates