Jump to content

custos

Members
  • Posts

    12
  • Joined

  • Last visited

custos's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I am able to use other methods etc for the following DLL using AutoIT, but 1 specific method creates the following error- (using autoit v3.3.6.1) ; Piece of applicable code---NOT ALL CODE ; Setup model input output arrays per model - ; CH wants inarray(1..numrows, 1..NumInputs), outarray(1..numrows, 1..3) ; Local $InArr[$NumRows +1 ][$ch.NumInputs +1] ; +1 necc, cause COM DLL ignores 0. ;YES $ch.NumInputs is properly filled as int by a call to the COM DLL Local $OutArr[$NumRows +1 ][3 +1 ] ; Always 3 on 2nd dimension, per CH documentaion Local $price[$NumRows] ;$InArr[1][0]= 51.39 $InArr[1][1]= 51.39 $InArr[1][2]= 51.26 $InArr[1][3]= 51.37 $InArr[1][4]= 2938964 _ArrayDisplay($InArr) _ArrayDisplay($OutArr) _ArrayDisplay($price) ; Call Prediction model But ensure enough data present in data file $ret = $ch.Predict($NumRows, $InArr, $OutArr) If $ret <> 0 Then ConsoleWriteError("ERROR: OpenModel returned: " & $ret) Exit EndIf _ArrayDisplay($OutArr) Error output from SCite C:\Users\khan\CODE\CHwrapper.au3 (62) : ==> The requested action with this object has failed.: $ret = $ch.Predict($NumRows, $InArr, $OutArr) $ret = $ch.Predict($NumRows, $InArr, $OutArr)^ ERROR >Exit code: 1 Time: 4.779 Interestingly the same type of error occurs when i use $ret = $ch.Predict()! (that is no args given) Yet it works w/ no problem using the following code in VB 2010- 'Piece of applicable code---NOT ALL CODE Dim inar(,) As Object Dim outar(,) As Object Dim price() As Object Dim objname As String Dim strStartupArguments(), mdfile As String Dim i, ret, intCount, numinputs, numrows As Integer numrows = 1 numinputs = model.numinputs ReDim inar(numrows, numinputs) 'the output array always has 3 columns ReDim outar(numrows, 3) strStartupArguments = System.Environment.GetCommandLineArgs 'Skip 0th cause its the name of program For intCount = 1 To UBound(strStartupArguments) 'Select Case strStartupArguments(intCount).ToLower 'Case "-arg1" 'Do your code for the arg1 argument 'Console.WriteLine(strStartupArguments(intCount)) inar(1, intCount) = strStartupArguments(intCount) Console.WriteLine(inar(1, intCount)) 'End Select Next 'Apply the model 'ret = model.Predict(1, inar, outar, price) 'Not a trading strategy model ReDim price(numrows) 'Apply the model ret = model.Predict(numrows, inar, outar) ', price) 'Outar contains the following: 'column 1: raw formula output 'column 2: trade signals (0=no signal, 1=enter long, -1=enter short) 'column 3: equity curve 'if col 1 return = model.MissingValue, means could not be computed. E.g. SMA(X), doesnt have X vals yet! If outar(numrows, 1) = model.MissingValue Then Console.WriteLine("Model Returning = Missing Value, E.g x data point missing for sma(x) not computing") End If End Sub End Module I've looked at VB debugger info and all the arrays seems the same going in (for autoit and VB), pls help been banging my head against this wall for 24+ hours now! I would hate to end up using VB2010 at this point. Also OLE/COM Browser(OLEview.exe) and here's what it says about this method- [id(0x6003000e)] VARIANT Predict( [in, out] VARIANT* numrows, [in, out] VARIANT* inar, [in, out] VARIANT* outar, [in, out, optional] VARIANT* price);
  2. btw used OLE/COM Browser(OLEview.exe) and here's what it says about this method- [id(0x6003000e)] VARIANT Predict( [in, out] VARIANT* numrows, [in, out] VARIANT* inar, [in, out] VARIANT* outar, [in, out, optional] VARIANT* price);
  3. I am able to use other methods etc for the following DLL using AutoIT, but 1 specific method creates the following error- (using autoit v3.3.6.1) ; Piece of applicable code---NOT ALL CODE ; Setup model input output arrays per model - ; CH wants inarray(1..numrows, 1..NumInputs), outarray(1..numrows, 1..3) ; Local $InArr[$NumRows +1 ][$ch.NumInputs +1] ; +1 necc, cause COM DLL ignores 0. ;YES $ch.NumInputs is properly filled as int by a call to the COM DLL Local $OutArr[$NumRows +1 ][3 +1 ] ; Always 3 on 2nd dimension, per CH documentaion Local $price[$NumRows] ;$InArr[1][0]= 51.39 $InArr[1][1]= 51.39 $InArr[1][2]= 51.26 $InArr[1][3]= 51.37 $InArr[1][4]= 2938964 _ArrayDisplay($InArr) _ArrayDisplay($OutArr) _ArrayDisplay($price) ; Call Prediction model But ensure enough data present in data file $ret = $ch.Predict($NumRows, $InArr, $OutArr) If $ret <> 0 Then ConsoleWriteError("ERROR: OpenModel returned: " & $ret) Exit EndIf _ArrayDisplay($OutArr) Error output from SCite C:\Users\khan\CODE\CHwrapper.au3 (62) : ==> The requested action with this object has failed.: $ret = $ch.Predict($NumRows, $InArr, $OutArr) $ret = $ch.Predict($NumRows, $InArr, $OutArr)^ ERROR >Exit code: 1 Time: 4.779 Interestingly the same type of error occurs when i use $ret = $ch.Predict()! (that is no agrs given) Yet it works w/ no problem using the following code in VB 2010- 'Piece of applicable code---NOT ALL CODE Dim inar(,) As Object Dim outar(,) As Object Dim price() As Object Dim objname As String Dim strStartupArguments(), mdfile As String Dim i, ret, intCount, numinputs, numrows As Integer numrows = 1 numinputs = model.numinputs ReDim inar(numrows, numinputs) 'the output array always has 3 columns ReDim outar(numrows, 3) strStartupArguments = System.Environment.GetCommandLineArgs 'Skip 0th cause its the name of program For intCount = 1 To UBound(strStartupArguments) 'Select Case strStartupArguments(intCount).ToLower 'Case "-arg1" 'Do your code for the arg1 argument 'Console.WriteLine(strStartupArguments(intCount)) inar(1, intCount) = strStartupArguments(intCount) Console.WriteLine(inar(1, intCount)) 'End Select Next 'Apply the model 'ret = model.Predict(1, inar, outar, price) 'Not a trading strategy model ReDim price(numrows) 'Apply the model ret = model.Predict(numrows, inar, outar) ', price) 'Outar contains the following: 'column 1: raw formula output 'column 2: trade signals (0=no signal, 1=enter long, -1=enter short) 'column 3: equity curve 'if col 1 return = model.MissingValue, means could not be computed. E.g. SMA(X), doesnt have X vals yet! If outar(numrows, 1) = model.MissingValue Then Console.WriteLine("Model Returning = Missing Value, E.g x data point missing for sma(x) not computing") End If End Sub End Module I've looked at VB debugger info and all the arrays seems the same going in (for autoit and VB), pls help been banging my head against this wall for 24+ hours now! I would hate to end up using VB2010 at this point.
  4. The following seems to works, trying to figure out how print to ALL matching cols now SELECT DateTime FROM Symbol1 INTERSECT SELECT DateTime FROM Symbol2
  5. ............... ; group 1 _SQLite_Exec (-1, "CREATE TABLE Symbol1 (DateTime TEXT PRIMARY KEY, Open TEXT, Vol TEXT, SynthVIX Text, VWAP Text);") If @error Then ConsoleWriteError("SQLERROR=" & @extended); EndIf For $i = 1 to $loopCount1 Step 1 $lineRead1 = FileReadLine($infile1, $i) $Array1 = StringSplit($lineRead1, ",") _ArrayDisplay($Array1) $sql_cmd &= "INSERT INTO Symbol1 (DateTime, Open, Vol, SynthVIX, VWAP) VALUES ('" & $Array1[1] & "', '" & $Array1[2] & "', '" & $Array1[3] & "', '" & $Array1[4] & "', '" & $Array1[5] & "');" _SQLite_Exec (-1, $sql_cmd) $sql_cmd = '' Next ;~ ; group 2 _SQLite_Exec (-1, "CREATE TABLE Symbol2 (DateTime TEXT PRIMARY KEY, Open TEXT, Vol TEXT, SynthVIX Text, VWAP Text);") If @error Then ConsoleWriteError("SQLERROR=" & @extended); EndIf For $i = 1 to $loopCount2 Step 1 $lineRead2 = FileReadLine($infile2, $i) $Array2 = StringSplit($lineRead2, ",") _ArrayDisplay($Array2) $sql_cmd &= "INSERT INTO Symbol2 (DateTime, Open, Vol, SynthVIX, VWAP) VALUES ('" & $Array2[1] & "', '" & $Array2[2] & "', '" & $Array2[3] & "', '" & $Array2[4] & "', '" & $Array2[5] & "');" _SQLite_Exec (-1, $sql_cmd) $sql_cmd = '' Next ............... OK thanks a lot, wasn't too bad although I coded all day like a kid just starting Tables are working the above code was used and double checked w/ SQL LiteExpert Personal. So hopefully last Q w/ project - What SQL statement would give me the INTERSECTION of the two tables based upon the DateTime col's of the tables (i.e. datetime1 = datetime2) PLS? PS Am adding following ":00" to DataTime col entries as i type this
  6. OK Folks trying out SQL Lite, (although don't know crap about SQL statements), cause algo is getting too complex and not worth the effort, will ask for SQL statement help once i get the tables working. Thanks
  7. @sleepydvdr Thanks, very helpful, making changes to get it going.
  8. @enaiman Thanks for your underhanded insults, always appreciated by new forum users. If I wasn't "rusty" I wouldn't have requested help, I figured somebody might have solved a very similar problem and could give me a code example, which would help me quickly. I'm sorry you answered my request.
  9. Any similar code examples per chance?
  10. Thats what i have been doing i.e. pull 1 row at time and comparing them but was doing it in excel. Do you have any code that does it all yanking 1 line at a time ? Also there is a Linux/Unix/Gnu commands also available for windoze that does this type of thing very efficiently probably a combination of "sort", "grep" and "comm". Might have to resort to that, unless some one herer an help
  11. All the other have integers or floating numbers only.
  12. Firstly, awesome s/w, I am an old school(rusty) C developer and had been looking for a year + for Rapid App Dev platform to drive windows apps and finally found AutoIT, last week. Thank god, cause always found too much complexity w/ MS Visual Express stuff, THANKS for your great s/w! I'm actually accomplishing a lot already. PROBLEM- I have large 200 MB csv files - could grow to 1-2 Gb in the future. So using Excel can become very painful (and would not prefer to use unless last resort) & suck at sql so don't wanna deal w/ Access either. I have 13+ files each with a "Date Time" column with data like: 7/22/2011 15:10 This data is to be used as an index to match up all 13+ files and produce a "Master" File if you will with only 1 "Date Time" column. The issue is all files have some "Date Time" data missing, so 10 might have "7/22/2011 15:03" but other wont. So that data needs to be ignored. Only data that has the same "Date Time" cell values in All files must be used to produce the Master File. Can somebody pls help with a function or program etc on how to do this natively in AUTOIt? Any and all help will be appreciated PS - I have already tried using _ExcelReadArray etc to do this but it is extremely slow, also the array stuff clobbered the date format when it read it
×
×
  • Create New...