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

Re: EXCEL, TS2000i, DDE or COM : How to get data to Excel ??



PureBytes Links

Trading Reference Links

    Ian:   I use the the example below in a signal called Exporter in
    in TS2000i strategy to export O,H,L,C,Open Interest Change and
    Volume to a .csv files. (i.e. Exp-LH.csc) I use it daily on
    Cotton,EDU,Copper,Yen,Coffee,Lean Hogs, Natural Gas, S&P and
    wheat.  I then use an excell macro to update the individual spread
    sheets from the daily *.csv files.  Hope this helps, if you have
    any questions, let me know.
    Happy New Year
    Grover
  -----------------------------------------------------------------
                Input: Decimals(4) ;
        
                Vars:  EqName(""),TradeStr1(""),OICh(0),VolAdj(0),VarHigh(0),VarLow(0),VarClose(0),
                   VarDecimals(0);
                        
                Condition1=Date>ElDate(12,31,1996);
                VolAdj=Volume/1000;
                OICh=OpenInt[0]-OpenInt[1];
        
                If CurrentBar = 1 Then Begin
                        EqName = "\Adata\SS\CYCLES\EXP-" + LeftStr(GetSymbolName, 2)+ ".csv";
                        FileDelete(EqName);
                End;
        
                EqName = "\Adata\SS\CYCLES\Exp-" + LeftStr(GetSymbolName, 2) + ".csv";
                        
                If  LeftStr(GetSymbolName,2)="NG" then begin
                        VarHigh=H*10;
                        VarLow=L*10;
                        VarClose=C*10;
                        VarDecimals=2;
                end
                else begin
                VarHigh=H;
                        VarLow=L;
                        VarClose=C;
                        VarDecimals=Decimals;
            end;
                If  LeftStr(GetSymbolName,2)="JY" then begin
                        VarHigh=H*100;
                        VarLow=L*100;
                        VarClose=C*100;
                        VarDecimals=2;
                end;
                If LastBarOnChart then begin
                        OICh = 0;
                    VolAdj= 0;
                End;
        
                TradeStr1 = ELDateToString(Date) + "," + NumToStr(VarHigh, VarDecimals) +"," +  
                          NumToStr(VarLow, VarDecimals) + "," + NumToStr(VarClose, VarDecimals) + "," + 
                      NumToStr(VolAdj,2) + "," + NumToStr(OICh,0) +
                      ","+NumToStr(OpenInt,0)+"," +NewLine;
                
                
                        
                If Condition1 then FileAppend(EqName, TradeStr1);
        
                   If Condition1 then Print(TradeStr1);