[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Print to File & Symbol Question



PureBytes Links

Trading Reference Links

To convert the Market symbol to a name that you can recognise, insert the
symbol and name into an array like the below:

Array:Markets[17,2]("");

Markets[0,0]="W0";
Markets[0,1]="SFE_Bank Bills";
Markets[1,0]="V3";
Markets[1,1]="SFE_SPI";
Markets[2,0]="V4";
Markets[2,1]="SFE_3Y Govt Bond";
Markets[3,0]="N6";
Markets[3,1]="SFE_10Y Bank Bills";
Markets[4,0]="C ";
Markets[4,1]="CBOT_Corn";
Markets[5,0]="C";
Markets[5,1]="CBOT_Corn";
Markets[6,0]="MB";
Markets[6,1]="CBOT_Muni Bond";
Markets[7,0]="O ";
Markets[7,1]="CBOT_Oats";
Markets[8,0]="O ";
Markets[8,1]="CBOT_Oats";
Markets[9,0]="RR";
Markets[9,1]="CBOT_Rough Rice";
Markets[10,0]="SM";
Markets[10,1]="CBOT_Soybean Meal";
Markets[11,0]="BO";
Markets[11,1]="CBOT_Soybean Oil";
Markets[12,0]="US";
Markets[12,1]="CBOT_US30Y TBond";
Markets[13,0]="TT";
Markets[13,1]="CBOT_US10Y Note";
Markets[14,0]="W ";
Markets[14,1]="CBOT_Wheat";
Markets[15,0]="W";
Markets[15,1]="CBOT_Wheat";
Markets[16,0]="S ";
Markets[16,1]="CBOT_Soybeans";
Markets[17,0]="S";
Markets[17,1]="CBOT_Soybeans";

{The below code finds the matches the above symbol with the chart you are
using and then uses the respective name of that symbol in the array}

If 1=1 then String1=LeftStr(GetSymbolName,2);
For Value10=0 to 12 begin
	If String1=Markets[Value10,0] then String1=Markets[Value10,1];
End;


If 1=1 then String1=LeftStr(GetSymbolName,2);
For Value10=0 to 12 begin
	If String1=Markets[Value10,0] then String1=Markets[Value10,1];
End;


{The below code prints to a file the date, time, commodity number, symbol
and the name of the respective symbol in the array}

fileappend("C:\TSResult\RBDaily.txt",TEXT(
NumToStr(CurrentDate,0),
" ",
CurrentTime:4:0,
" ",
NumToStr(commoditynumber,0),
" ",
LeftStr(GetSymbolName,2),
" ",
String1,
" ")
+NewLine);
end;

I hope this helps!


Regards,

Robert Bianchi

Email:R.Bianchi@xxxxxxxxx

  ,-._|\                           
 /  Oz  \ 
 \_,--._/ 
       v