open2chExtender / iforexTradeExtender

// ==UserScript==
// @license MIT
// @author  gmoTradeExtender
// @name    iforexTradeExtender
// @version               2018/11/22
// @description Version 2018/11/22
// @include https://trader.iforex.com/webpl3/webtrader.html?*
// @exclude https://coin.z.com/jp/member/trade/chart/*
// @exclude https://coin.z.com/jp/member/exchange/chart/*
// @run-at document-end
// @grant   none
// ==/UserScript==

(function(){W=500;H=480;if(!navigator.userAgent.match(/(iPhone|iPod|iPad|Linux|Android)/)){W=650;}
FX=' width='+(W)+' height=202 frameborder=0 border=1 style=position:relative;left:-163px; scrolling=no allowtransparency=false ';
TX='style=z-index:1;position:absolute!important;top:'+(H+860)+'px;left-margin:auto;right-margin:auto;width:1310px;>';
TX+='<style>#SummaryView,#QuotesTableScroll{height:'+(H)+'px!important;}div::-webkit-scrollbar{display:none;}div#tradingButtons{position:relative!important;left:25px;top:0px;}</style>';
TX+='<iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/10005></iframe><iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/1005></iframe>';
TX+='<iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/10004></iframe><iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/1004></iframe>';
TX+='<iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/10002></iframe><iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/1002></iframe>';
TX+='<iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/10003></iframe><iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/1003></iframe>';
TX+='<iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/10001></iframe><iframe'+(FX)+'src=https://coin.z.com/jp/member/trade/chart/1001></iframe>';
TX+='<iframe'+(FX)+'src=https://coin.z.com/jp/member/exchange/chart/10001></iframe><iframe'+(FX)+'src=https://coin.z.com/jp/member/exchange/chart/1001></iframe>';
//TX+='<iframe style=width:0px;height:0px;border:0px; onload=this.src=this.src; src=https://coin.z.com/jp/member/exchange/chart/1001></iframe>';
setTimeout("if(d=document.getElementsByTagName('div')){for(i=d.length-1;0<i;i--){if('logo'==d[i].className){d[i].innerHTML+='<span "+TX+"</span>';}}}",5000);
localStorage['SpreadRateSkip']=1500;SpreadRate=(function(param){return(param[0].replace(/(\n|\r)/g,''));})`
if(0<(T=parseInt(localStorage['SpreadRateSkip'])-50)){localStorage['SpreadRateSkip']=T}else{BID=0;ASK=0;if(('https://trader.iforex.com/webpl3/webtrader.html?view=2'==location.href)){
if(d=document.getElementsByTagName('span')){for(i=10;50>i;i++){if('Change'==d[i].innerHTML.substr(0,6)){d[i].innerHTML='Change(SP%)';break;}if('チェンジ'==d[i].innerHTML.substr(0,4)){d[i].innerHTML='チェンジ(スプ%)';break;}}}
if(d=document.getElementsByTagName('tr')){N=d[1].innerHTML.split('<td').length-1;if(d=document.getElementsByTagName('td')){
for(i=0;d.length>i;i++){if((2<=i%N)&&(i%N<=4)){;}else{continue;}if((2==i%N)&&('rate bidWidth'!=d[i].className)){break;}
DT=d[i].innerHTML.replace(/<[^>]*>/img,'').replace(/([^\\d\\.]+)/img,(''));if(2==i%N){BID=parseFloat(DT.substr(0,DT.length/2));}if(3==i%N){ASK=parseFloat(DT.substr(0,DT.length/2));}
if((4==i%N)&&(0<BID*ASK)){SP=(ASK-BID);SPR=100*SP/BID;d[i].innerHTML=d[i].innerHTML.split('%')[0]+'%<font color=black>('+(SPR+'00000').substr(0,5)+'%)</font>';}}}}}}`;setInterval(SpreadRate,50);})();