How parse non OHLC json file (AmiQuote 4.10, javascript), save as csv-file?

The answers to your questions are:

  1. Yes (your JSON is different than Polygon sample but you can still process the file)
  2. Yes (just uncheck "Auto-import" checkbox in AmiQuote

Here is a Javascript code that makes conversion of your JSON to CSV:

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

   csv = "";

   for( i = 0; i < items.length; i++ )
   {
       item = items[ i ];
       csv += item.symbol + "," + item.estimate + "," + item.period + "\n";
   }

   return csv;
}
10 Likes