AmiQuote 4.10 kudos

I didn't want to express my thanks for the new version from within the actual announcement posting, so wanted to do it here...

This is great, it adds many extensible and generic possibilities rather than just addressing a specific download source. Excellent and thank you Tomasz!

Quick FYI regarding the Polygon.IO data example. Not sure if the bug is Polygons or an artifact of JavaScript, but as you can see below in the image, data is imported and a timestamp created with a minute of "60", as seen below for GE @ 2021-08-17, 10:60:00,...(circled in Yellow).

As a result the bar in the chart has no timestamp in the upper left info line (circled in red). And looks as if it was randomly plotted chronologically as a result (circled in blue).

Capture

Also for those using Polygon.IO, looks like intra-day data is timestamped at "End of intervals" from what I can tell.

1 Like

Probably rounding / modulus issue inside Javascript, apparently Javascript getMinutes() returned 60, even though it should return 00

Update: I checked and there is a mistake in JavaScript code in dateToHMS function.
It added 1 to getMinutes() while it shouldn't.

function dateToHMS( d )
{
	return	 pad( d.getHours(), 2 ) + ":" +
           pad( d.getMinutes() /* +1 was a mistake */, 2 ) + ":" +
           pad( d.getSeconds(), 2 );
}

Entire Javascript code corrected is here:

function pad(num, size) 
{
    num = num.toString();
    while (num.length < size) num = "0" + num;
    return num;
}

function dateToYMD( d )
{
	return  d.getFullYear() + "-" +
           pad( d.getMonth() + 1, 2 ) + "-" +
           pad( d.getDate(), 2 );
}

function dateToHMS( d )
{
	return	 pad( d.getHours(), 2 ) + ":" +
           pad( d.getMinutes(), 2 ) + ":" +
           pad( d.getSeconds(), 2 );
}

// the processing function takes text as input and produces text as ouput
function Process( input )
{
	try
	{
		all = JSON.parse( input );

		if( all.status == "ERROR" ) 
		{
			return "Error: " + all.error;
		}

		if( all.resultsCount == 0 )
		{
			return "Error: no data for this symbol";
		}

		quotes = all.results;

		output = "";
		for( i = 0; i < quotes.length; i++ )
		{
			date = new Date( quotes[ i ].t );

			open = quotes[ i ].o;
			high = quotes[ i ].h;
			low = quotes[ i ].l;
			close = quotes[ i ].c;
			volume = quotes[ i ].v;
		
			output += dateToYMD( date ) + ", ";
			output += dateToHMS( date ) + ", ";

			output += open + ", ";
			output += high + ", ";
			output += low + ", ";
			output += close + ", ";		
			output += volume + "\n";		
		}
	}
	catch( e )
   {
      output = "Error: " + e.name + ": " + e.message;
   }

	return output;
}
1 Like

Wow very good Tom, as fast as lightning. :slightly_smiling_face:

So I would correct myself and perhaps suggest users to set the "Timestamp" to represent "Start-time of interval" and to set the end of the day session to 15:59 to get rid of the leftover small remnant 1min bar at the end of the day. Then it will look about right (Me thinks).

Yes that is correct.

Thanks for the updated Amiquote @Tomasz .

The Download ticker list currently populates two exchanges as of now. Is there a possibility to add more exchanges?

image

Yes there will be much more. I have just added 20 exchanges and more will come soon. If you open that dialog now you will see more.

image

2 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.