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

Re: File Append function issues



PureBytes Links

Trading Reference Links

Hello Paul,
  FWIW The following signal in 2000i cranks out a .csv file each time
  I run it on a commodity.  date, high, low, close, OI and volume. the
  format might help you.

  -------------------------------------------------------------------------------
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 = "\Documents and Settings\Grover Ericksen\My Documents\ss\CYCLES\EXP-" + LeftStr(GetSymbolName, 2)+ ".csv";
                        FileDelete(EqName);
                End;
        
                EqName = "\Documents and Settings\Grover Ericksen\My Documents\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)="WY" 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) +"," +NewLine;
                
                        
                If Condition1 then FileAppend(EqName, TradeStr1);
        
                   If Condition1 then Print(TradeStr1);  
  

 ---------------------------------------------------------------------------------------
Best regards,
 Grover  
                        mailto:grover@xxxxxxxxxxxx