Gamestudio Links
Zorro Links
Newest Posts
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
Zorro version 3.0 prerelease!
by TipmyPip. 02/24/26 17:09
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (Martin_HH, TipmyPip, AndrewAMD, Grant, USER0328), 5,287 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How do I get started with writing a plugin? #437052
02/08/14 13:27
02/08/14 13:27
Joined: Feb 2014
Posts: 2
R
randomshinichi Offline OP
Guest
randomshinichi  Offline OP
Guest
R

Joined: Feb 2014
Posts: 2
I want to write my own plugin for a broker, so I took a look at the FXCM module in Zorro's source folder. However I'm not sure how I'm supposed to build this thing. Do I use Visual Studio C++? Which version? Is this really needed, because I don't have it:
#include "..\include\trading.h" // enter your path to trading.h

Also worrying is the line that imports fxcore.dll - what functions does it provide that I won't need in my own code?

Re: How do I get started with writing a plugin? [Re: randomshinichi] #437069
02/08/14 19:11
02/08/14 19:11
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline
Member
Mithrandir77  Offline
Member

Joined: Nov 2013
Posts: 123
Originally Posted By: randomshinichi
I want to write my own plugin for a broker, so I took a look at the FXCM module in Zorro's source folder. However I'm not sure how I'm supposed to build this thing. Do I use Visual Studio C++? Which version? Is this really needed, because I don't have it:
#include "..\include\trading.h" // enter your path to trading.h

Also worrying is the line that imports fxcore.dll - what functions does it provide that I won't need in my own code?


You can use any IDE for developing (Codeblocks is my favorite for simple C++ projects), I think they put visual studio c++ as an example. In my case I have Visual C++ 2010 Express Edition, you can ask for a key to your mail to remove the 1 month trial.

The include.h header file comes with the installation of Zorro, I for instance have it at: C:\Program Files (x86)\Zorro\include\trading.h . It has all the "skeleton" for the trading (structs and definitions).

Concerning fxcore.dll, I think it is a library provided by FXCM as part of their API -so you instead should import the library provided by your broker- because (in my case) in the source file:

C:\Program Files (x86)\Zorro\Source\FXCMplugin.cpp

There are these lines:

Code:
using namespace FXCore;

ITradeDeskAutPtr g_pTradeDesk = 0;
(...)
void FXCM_Logout() 
{
	try {
		g_pTradeDesk->Logout();
(...)



Which seems to me this:

using namespace FXCore: Here it is using functions from a namespace that has a suspicious name laugh I guess that from FXCM

ITradeDeskAutPtr: An interface (if you don't know what it is consider like a "wrapper" to other functions) pointer to an FXCM object.

g_pTradeDesk->Logout(); : Here it is logging out using one of the functions provided by FXCM.

In a nutshell, you have to make like a bridge that connects Zorro to the Broker. On the Zorro side you have the 9 functions to implement and that you will export to a dll. In these functions you "talk" to the broker API.

On the broker side, you have the API. Their API may be more or less transparent to you (ie: they may provide some wrapper functions like in the example with FXCM) or not.

Note: Transparent means that the functions are like a black-box, ie you don't have to mess too much with their API internal representation. When I heard it, I thought that transparent was more like white-box. Funny.

Re: How do I get started with writing a plugin? [Re: Mithrandir77] #437078
02/08/14 22:20
02/08/14 22:20
Joined: Feb 2014
Posts: 2
R
randomshinichi Offline OP
Guest
randomshinichi  Offline OP
Guest
R

Joined: Feb 2014
Posts: 2
Thanks so much for the detailed reply! If I understand the code correctly, I should just change the functions with the DLLFUNC prefix, keeping their arguments and returns, and I can just delete the normal functions without the DLLFUNC prefix, right?

Re: How do I get started with writing a plugin? [Re: randomshinichi] #437081
02/08/14 23:38
02/08/14 23:38
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline
Member
Mithrandir77  Offline
Member

Joined: Nov 2013
Posts: 123
Originally Posted By: randomshinichi
Thanks so much for the detailed reply! If I understand the code correctly, I should just change the functions with the DLLFUNC prefix, keeping their arguments and returns, and I can just delete the normal functions without the DLLFUNC prefix, right?


Yes, make sure to leave

Code:
// broker.cpp : Defines the entry point for the DLL application.

#include "stdafx.h"

BOOL APIENTRY DllMain( 
  HANDLE hModule,
  DWORD ul_reason_for_call,
  LPVOID lpReserved)
{
  return TRUE;
}



and code the 9 or 10 functions that says in the manual.
Note that I haven't tried coding a DLL yet -I just haven't been able to find any broker that provide an API for free or without having to deposit with them- so make sure to follow the instructions from http://zorro-trader.com/manual/en/brokerplugin.htm


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1