I have just updated FT2 to version 2.6 and found that the script example may be lacking file(s).
For example, under "Examples\Scripts\C++" folder, I see only 3 files:
- readme.txt
- ScriptInterfaceUnit.h
- TechnicalFunctions.h
Did you forget to include .cpp file(s) and a .def file?
Missing script example?
-
- Posts: 14
- Joined: Sun Sep 04, 2011 6:36 am
Found it out. You basically need three steps: Init, Done, Execute
#include <windows.h>
#include "ScriptInterfaceUnit.h"
#include "TechnicalFunctions.h"
EXPORT void __stdcall Init()
{
ScriptShortName("Put1order");
ScriptDescription("Put 1 Order");
}
EXPORT void __stdcall Done()
{
}
EXPORT void __stdcall Execute()
{
int OrderHandle;
SendInstantOrder("EURUSD",op_Sell,0.08, 0, Bid()-0.001, "Short Order", 333, OrderHandle);
}
Additionally you need a .def file with this content:
LIBRARY ObjectsTest
EXPORTS Init
Done
Execute
ReplaceStr
IntrfProcsRec
#include <windows.h>
#include "ScriptInterfaceUnit.h"
#include "TechnicalFunctions.h"
EXPORT void __stdcall Init()
{
ScriptShortName("Put1order");
ScriptDescription("Put 1 Order");
}
EXPORT void __stdcall Done()
{
}
EXPORT void __stdcall Execute()
{
int OrderHandle;
SendInstantOrder("EURUSD",op_Sell,0.08, 0, Bid()-0.001, "Short Order", 333, OrderHandle);
}
Additionally you need a .def file with this content:
LIBRARY ObjectsTest
EXPORTS Init
Done
Execute
ReplaceStr
IntrfProcsRec
Who is online
Users browsing this forum: No registered users and 22 guests