Could anyone suggest a way of marking the FX exchange start time on tick, volume, or period charts based on the following script for minute charts?
Many thanks!
Many thanks!
PHP Code:
/**Foreign Exchange Market - Start Time**/
var fpArray = new Array();
var x = 0;
/* */
function preMain(){
setPriceStudy(true);
setStudyTitle("fxMarket Marker");
setShowCursorLabel(false);
setShowTitleParameters(false);
setComputeOnClose();
/* */
fpArray[x] = new FunctionParameter("FX1", FunctionParameter.NUMBER);
with(fpArray[x]){
setName("FX1");
setDefault(1500);
}
fpArray[x] = new FunctionParameter("FX2", FunctionParameter.NUMBER);
with(fpArray[x]){
setName("FX2");
setDefault(1700);
}
fpArray[x] = new FunctionParameter("FX3", FunctionParameter.NUMBER);
with(fpArray[x]){
setName("FX3");
setDefault(2200);
}
fpArray[x] = new FunctionParameter("FX4", FunctionParameter.NUMBER);
with(fpArray[x]){
setName("FX4");
setDefault(000);
}
fpArray[x] = new FunctionParameter("FX5", FunctionParameter.NUMBER);
with(fpArray[x]){
setName("FX5");
setDefault(100);
}
fpArray[x] = new FunctionParameter("FX6", FunctionParameter.NUMBER);
with(fpArray[x]){
setName("FX6");
setDefault(500);
}
fpArray[x] = new FunctionParameter("LC", FunctionParameter.COLOR);
with(fpArray[x]){
setName("Line Color");
setDefault(Color.brown);
}
fpArray[x] = new FunctionParameter("BT", FunctionParameter.NUMBER);
with(fpArray[x]){
setName("Bar Thickness");
setDefault(1);
}
}
/* */
function main(FX1,FX2,FX3,FX4,FX5,FX6,LC,BT){
if ((getHour()*100)+getMinute()==FX1){
drawLineRelative(0,0,0,9999,PS_DOT, BT, LC, "SYD");
drawTextRelative(-2,0,"SYD",LC,null,Text.RELATIVETOBOTTOM,"Arial",9,"SYD");
}
if ((getHour()*100)+getMinute()==FX2){
drawLineRelative(0,0,0,9999,PS_DOT, BT, LC, "TOK");
drawTextRelative(-2,0,"TOK",LC,null,Text.RELATIVETOBOTTOM,"Arial",9,"TOK");
}
if ((getHour()*100)+getMinute()==FX3){
drawLineRelative(0,0,0,9999,PS_DOT, BT, LC, "MSK");
drawTextRelative(-2,0,"MSK",LC,null,Text.RELATIVETOBOTTOM,"Arial",9,"MSK");
}
if ((getHour()*100)+getMinute()==FX4){
drawLineRelative(0,0,0,9999,PS_DOT, BT, LC, "PAR");
drawTextRelative(-2,0,"PAR",LC,null,Text.RELATIVETOBOTTOM,"Arial",9,"PAR");
}
if ((getHour()*100)+getMinute()==FX5){
drawLineRelative(0,0,0,9999,PS_DOT, BT, LC, "LND");
drawTextRelative(-2,0,"LND",LC,null,Text.RELATIVETOBOTTOM,"Arial",9,"LND");
}
if ((getHour()*100)+getMinute()==FX6){
drawLineRelative(0,0,0,9999,PS_DOT, BT, LC, "NYC");
drawTextRelative(-2,0,"NYC",LC,null,Text.RELATIVETOBOTTOM,"Arial",9,"NYC");
}
/* */
return null;
}
Comment