in Search

writing of another price data

Last post 03-25-2009, 4:03 by mumin16. 5 replies.
Sort Posts: Previous Next
  •  03-20-2009, 3:54 29219

    writing of another price data

    how avoid  the writing of another price data  over the one price data?
    why happen this instance?
  •  03-20-2009, 4:20 29220 in reply to 29219

    Re: writing of another price data

    const a_psDataRec


    If you want people to help you with your coding, please post the code!


    wabbit ]:D]


    "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
    Edsgar W. Dijkstra

     

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

  •  03-20-2009, 4:53 29221 in reply to 29220

    Re: writing of another price data

    ; search FOO
                mov psSecurityID.dwTotalSize,sizeof psSecurityID;
                mov al, byte ptr[cDirNumber]
                mov psSecurityID.cDirNumber,al
                invoke lstrcpy,addr psSecurityID.szSymbol,"FOO"
                mov psSecurityID.cPeriodicity,"I";                           
                mov psSecurityID.wInterval,60;                              
                invoke MSFL1_GetSecurityHandle,addr psSecurityID,addr hSecurity;  

    ;if not find FOO then add FOO
                .if eax!=MSFL_NO_ERR
                    mov psSecurityInfo.dwTotalSize ,sizeof psSecurityInfo;
                    invoke lstrcpy,addr psSecurityInfo.szName,"Foo Company"
                    invoke lstrcpy,addr psSecurityInfo.szSymbol,"FOO"
                    mov psSecurityInfo.cPeriodicity , "I"; intraday
                    mov psSecurityInfo.wInterval,60;60 sec
                    mov eax,iDate;
                    mov psSecurityInfo.lFirstDate, eax;
                    mov psSecurityInfo.lLastDate, eax;
                    mov psSecurityInfo.lCollectionDate,eax
                    mov psSecurityInfo.wDataAvailable , MSFL_DATA_DATE + MSFL_DATA_TIME + MSFL_DATA_OPEN  + MSFL_DATA_HIGH + MSFL_DATA_LOW  + MSFL_DATA_CLOSE + MSFL_DATA_VOLUME;
                    invoke MSFL1_AddSecurity,cDirNumber,addr psSecurityInfo,0
            
                .endif    
                

    ; and write price data  of  FOO
     
                mov eax,iDate
                mov psPriceRec.lDate,eax
                mov eax,iTime;
                mov psPriceRec.lTime,eax
                invoke crt_sscanf, "1.1",CTXT("%f"),addr lpOut
                mov eax,lpOut
                mov psPriceRec.fOpen,eax
                invoke crt_sscanf, "3.3",CTXT("%f"),addr lpOut
                mov eax,lpOut            
                mov psPriceRec.fHigh,eax
                invoke crt_sscanf, "1.1",CTXT("%f"),addr lpOut
                mov eax,lpOut
                mov psPriceRec.fLow,eax
                invoke crt_sscanf, "2.2",CTXT("%f"),addr lpOut
                mov eax,lpOut
                mov psPriceRec.fClose,eax
                invoke crt_sscanf, "10000.0",CTXT("%f"),addr lpOut
                mov eax,lpOut
                mov psPriceRec.fVolume,eax
                mov psPriceRec.wDataAvailable, MSFL_DATA_DATE + MSFL_DATA_TIME + MSFL_DATA_OPEN  + MSFL_DATA_HIGH + MSFL_DATA_LOW  + MSFL_DATA_CLOSE + MSFL_DATA_VOLUME;
                
                invoke MSFL1_GetSecurityHandle,addr psSecurityID,addr hSecurity;
                invoke MSFL1_LockSecurity,hSecurity,MSFL_LOCK_FULL_LOCK
                
                
                invoke MSFL1_WriteDataRec,hSecurity,addr psPriceRec,1
                invoke MSFL1_UnlockSecurity,hSecurity


  •  03-20-2009, 6:10 29222 in reply to 29221

    Re: writing of another price data

    Nothing in the code immediately strikes me as being an obvious cause of the problem (I have had a few glasses of wine after a long day, so my reading of ASM might be a little fuzzy), except that your previous posts on the Forum have all been concerning writing data with the MDK and I believe you only have the Read version?

    If you explained in detail what you are trying to achieve with these continuous attempts to write data, perhaps we might have a better solution to offer?



    wabbit Big Smile [:D]


    "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
    Edsgar W. Dijkstra

     

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

  •  03-23-2009, 6:29 29240 in reply to 29222

    Re: writing of another price data

    With thanks to Neale who pointed this post out to me again....

    "invoke MSFL1_WriteDataRec,hSecurity,addr psPriceRec,1"

    MSFL1_WriteDataRec(HSECURITY hSecurity, const MSFLPriceRecord_struct *psPriceRec,)
    vs.
    MSFL2_WriteDataRec(HSECURITY hSecurity, const MSFLPriceRecord_struct *psPriceRec, BOOL Overwrite)

    MSFL2 has three arguments, the third is overwrite.


    Hope this helps.

    wabbit Big Smile [:D]



    "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
    Edsgar W. Dijkstra

     

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

  •  03-25-2009, 4:03 29250 in reply to 29240

    Re: writing of another price data

    thanks my brother but i detach the problem. the problem is false function use. i use MSFL1_InsertDataRec instead of  MSFL1_WriteDataRec.
View as RSS news feed in XML