logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
mumin16  
#1 Posted : Friday, March 20, 2009 3:54:52 AM(UTC)
mumin16

Rank: Member

Groups: Registered, Registered Users
Joined: 3/16/2009(UTC)
Posts: 10

how avoid the writing of another price data over the one price data?
why happen this instance?
wabbit  
#2 Posted : Friday, March 20, 2009 4:20:57 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
const a_psDataRec


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


wabbit ]:D]

mumin16  
#3 Posted : Friday, March 20, 2009 4:53:19 AM(UTC)
mumin16

Rank: Member

Groups: Registered, Registered Users
Joined: 3/16/2009(UTC)
Posts: 10

; 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


wabbit  
#4 Posted : Friday, March 20, 2009 6:10:59 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
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 [:D]

wabbit  
#5 Posted : Monday, March 23, 2009 6:29:11 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
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 [:D]


mumin16  
#6 Posted : Wednesday, March 25, 2009 4:03:28 AM(UTC)
mumin16

Rank: Member

Groups: Registered, Registered Users
Joined: 3/16/2009(UTC)
Posts: 10

thanks my brother but i detach the problem. the problem is false function use. i use MSFL1_InsertDataRec instead of MSFL1_WriteDataRec.
kudret  
#7 Posted : Friday, July 6, 2012 2:08:43 AM(UTC)
kudret

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/5/2012(UTC)
Posts: 2

Hi everybody I have a question about metastock. When I connect a program to metastock as a real time with a periodicity(1 min, 5 min, 10min etc). it shows values correctly but when I change periodicity to daily it shows open and low values zero(0) it is about metastock bug or I have a problem with my program? note: I use metastock to follow stock market values.
wabbit  
#8 Posted : Saturday, July 7, 2012 12:12:55 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Instead of tagging onto an ancient thread, your post was split into a new thread as it is on a completely different topic.

http://forum.equis.com/forums/thread/38745.aspx
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.