Missing script example?

How to create strategies and indicators
Message
Author
ttega
Posts: 3
Joined: Tue May 11, 2010 9:51 pm

Missing script example?

#1 Postby ttega » Tue Nov 02, 2010 9:12 pm

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?

readyyy
Posts: 14
Joined: Sun Sep 04, 2011 6:36 am

#2 Postby readyyy » Sun Apr 15, 2012 5:47 am

Your right, the script example folder is incomplete. Just trying to figure out how to write a script.

readyyy
Posts: 14
Joined: Sun Sep 04, 2011 6:36 am

#3 Postby readyyy » Sun Apr 15, 2012 7: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


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 22 guests