|
|
![]() |
||
Interacting with MySQL
|
||
| Scripting Autotrading, Indicators, Strategies, Advisors. MQL, EasyLanguage, PTL Builder |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there any documentation about performing SQL queries from PTL scripts to MySQL server?
How to fetch data from SELECT query results? Any examples? |
|
#2
|
|||
|
|||
|
No, it itsn't, because PTL Builder doesn't support SQL directly.
But you can crete a C#/VB.NET project from PTL Builder and access to the DB via .NET classes. Last edited by nicky : 02-08-2010 at 07:02 AM. |
|
#3
|
|||
|
|||
|
I couldn't create a VB.NET project because the PTL Builder crashes under Vista when I'm trying to launch any VB script, even an empty one like this:
Code:
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Text
Imports System.Drawing
Imports PTLRuntime.NETScript
Namespace test20
' <summary>
' test20
' test
' </summary>
Public Class test20
Inherits NETStrategy
Public Sub New()
MyBase.New()
MyBase.Author = "test"
MyBase.Comments = "test"
MyBase.Company = ""
MyBase.Copyrights = ""
MyBase.DateOfCreation = "08.02.2010"
MyBase.ExpirationDate = 0
MyBase.Version = "1.0"
MyBase.Password = "66b4a6416f59370e942d353f08a9ae36"
MyBase.ProjectName = "test20"
End Sub
' <summary>
' Entry point. This function is called when new quote comes
' </summary>
Overrides Sub OnQuote()
'do nothing
End Sub
End Class
End Namespace
Code:
imported from "user32.dll" function bool MessageBeep (int myarg);
function void OnQuote() entry
{
//Alert(Symbol); //Symbol is the instrument's name
};
function bool Init() entry
{
user32.MessageBeep(0);
Alert("Hello world!");
};
Is there any solution? |
|
#4
|
|||
|
|||
|
If PTL Builder cannot find the required .dll in the ..\Include folder it tries to find it into the system directory. Please copy this dll into ...\Include folder or give PTL Builder more privileges .
|
|
#5
|
|||
|
|||
|
Thanks. Now it seems to work.
By the way, one more stupid question: Where can I take a look at the log written by Print() function? |
|
#6
|
|||
|
|||
|
The log is displayed by Strategy panel (client) or Strategy results (builder).
|