Backlinks from other websites are the lifeblood of our site and a primary source of new traffic.
If you use our chart images on your site or blog, we ask that you provide attribution via a link back to this page. We have provided a few examples below that you can copy and paste to your site:
Link Type
HTML Code (Click to Copy)
Turkey foreign direct investment - Chart
Turkey foreign direct investment - Table
Your data export is now complete. Please check your download folder.
No data is available
Get notified instantly when MacroVar new signals are available for Turkey foreign direct investment.
Embed the latest Turkey foreign direct investment Chart, Data Table or text to your website by clicking the 3 options below.
\n' +
'\n'+
'';
$(".after-download-popup .embed-code .embed-type-chart .embed-code-copy textarea").val(codeChart);
var codeTable =
'\n' +
'\n'+
'';
$(".after-download-popup .embed-code .embed-type-table .embed-code-copy textarea").val(codeTable);
},
error: function (request, status, error) {
//console.log(request.responseText + "error =" + error);
$(".after-download-popup .popup-body").html("");
var errorHtml = $("").appendTo($(".after-download-popup .popup-body")).css('color','red').text("Invalid Wid");
},
complete: function(result) {
//open the popup
$(".popup-overlay.after-download-popup, .popup-content").addClass("active");
$(".after-download-popup").show();
}
});
});
//download image data
$("#chart-tabs-block a.download-image").click(function () {
var wid = "";
console.log("---Downloading data -image");
var apiUrl = "https://macrovar.com/wp-json/mesmerize-api/v1/market-data-wid";
$.ajax({
type: "POST",
url: apiUrl,
crossDomain: true,
data: {"wid":wid},
dataType: "json",
success: function (result) {
//get returned info
console.log(result);
var data = result['data'];
var variableDetail = result['variable-detail'];
//update the content of the popup that opens after download
//set the embed link title
$(".after-download-popup .embed-code-title").text(variableDetail['cnt'] + ' ' + variableDetail['indicator'] + ' ' + variableDetail['tp']);
//set the download data type in the success message
$(".after-download-popup .download-success-message .download-data-type").text("image");
//set the embed code to copy
var ifw = "800px", ifh = "420px";
var codeChart =
'\n' +
'\n'+
'';
$(".after-download-popup .embed-code .embed-type-chart .embed-code-copy textarea").val(codeChart);
var codeTable =
'\n' +
'\n'+
'';
$(".after-download-popup .embed-code .embed-type-table .embed-code-copy textarea").val(codeTable);
//create canvas
var chartContainer = $("" ).appendTo( $("body") );
var canvas = $("#macrovar-chart");
//prepare data
var labels = [];
var dataValue = [];
data.forEach( (row, index) => {
labels[index] = row['date'];
dataValue[index] = row['value'];
});
var maxTicksLimit = data.length / 5;
var myChart = new Chart(canvas, {
type: 'line',
data: {
labels: labels,
datasets: [{
data: dataValue,
fill: false,
borderColor: 'rgb(45, 121, 222)',
tension: 0.1
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: false,
grid:{
display:false
}
},
x:{
ticks: {
maxTicksLimit: maxTicksLimit
}
}
},
maintainAspectRatio: false,
plugins: {
legend: {
display: false
},
subtitle: {
display: true,
align: 'center',
position: 'left',
text: variableDetail['var'],
}
},
animation: {
onComplete: function () {
// Get the chart's base64 image string
var a = document.createElement('a');
a.href = myChart.toBase64Image();
a.download = variableDetail['var']+'.png';
// Trigger the download
a.click();
//remove chart
chartContainer.remove();
},
}
},
plugins: [{
beforeDraw: function(chart) {
//draw background
var ctx = chart.ctx;
ctx.fillStyle = 'white';
ctx.fillRect(0, 0, chart.width, chart.height);
}
}]
});
},
error: function (request, status, error) {
console.log(request.responseText + "error =" + error);
$(".after-download-popup .popup-body").html("");
var errorHtml = $("").appendTo($(".after-download-popup .popup-body")).css('color','red').text("Invalid Wid");
},
complete: function(result) {
//open the popup
$(".popup-overlay.after-download-popup, .popup-content").addClass("active");
}
});
});
//copy code to clipborad - in the popup
$(".after-download-popup .embed-code .embed-code-copy textarea").click(function(e){
e.preventDefault();
$(this).select();
document.execCommand('copy');
console.log("--code copied to clipboard");
});
});
function generateEmbedCode() {
var tabs = $('#chart-tabs-block'),
id = $('.select-embed li.active', tabs).data('id'),
code = '',
ifw = $('[name="share-width"]', tabs).val(),
ifh = $('[name="share-height"]', tabs).val(),
wid = "32403";
if (id && ifw && ifh) {
if (id == 'chart') {
code = ' source: macrovar.com';
/*code =
'\n' +
'\n'+
'';
*/
} else if (id =='data') {
//let data = $('#data table', tabs).html();
// data = data.replace(/[\t\n\r]|[\s]{2,}/gm, '');
//code = '
'+$.trim(data)+'
';
code =
'\n' +
'\n'+
'';
} else if (id =='txt') {
code =
'\n' +
'\n'+
'\n\n'+
'*** In your webpage place the following code to display the latest up to date value of this indicator. ***\n'+
'';
}
$('.copycode textarea', tabs).val(code);
}
}
function previewEmbed(e) {
e.preventDefault();
var tabs = $('#chart-tabs-block'),
id = $('.select-embed li.active', tabs).data('id');
if (id == 'chart') {
window.open('','_blank');
} else {
$('button#data-tab').click();
}
}
Statistics
Historical Data
The MacroVar database offers free access to historical data for the , dating back to 1950. This extensive dataset is
readily available through MacroVar versatile platforms, including a user-friendly web interface, a robust Python API, and convenient Excel integration. By leveraging these tools, users can efficiently retrieve and analyze
decades of data, supporting a wide range of research, financial analysis, and decision-making processes.
Welcome to MacroVar the financial analytics platform designed to help you identify trading and investment opportunities using data driven models. MacroVar uses statistical multi-factor models to analyze financial markets to generate automated signals for short-term trading and long-term investing. MacroVar models and the data analysed are transparent for anyone to explore.
Get Unlimited access to our database for Free by inviting your friends to MacroVar
Help your friends make the right business & financial decisions using free MacroVar analytics. Click here to invite them and get upgraded for free.