You need to enable JavaScript in order to visit our site!
 
Logo PTMC
NAVIGATION
CANCEL
 
or via PTMC account
Restore password
or via PTMC account
Logo PTMC
NAVIGATION
or via PTMC account
Restore password
or via PTMC account
or via PTMC account
Restore password
or via PTMC account
PTMC team 08.07 2016

How to create a PTMC custom panel in a 5 steps?

Hey there, Protraders!

Are you feeling like ready to become a power user and more productive with PTMC? Would you like to customize or extend the capabilities of PTMC? If so — our guide is for you.

There are many features already available with PTMC platform from the box, however each individual trader strives to set things for own purposes. This guide intends to put your ideas on the rails. No strong programming knowledge required to build simple plug-ins quickly.

PTMC's API for plug-in development is the same as for indicators and trade systems building (Pt# Class). It grants access to accounts, instruments, positions, different order types, requesting quotes etc. A power of API is practically unlimited and constantly evolving.

Let’s start!

1) Create the coding environment

Launch MS Visual Studio. Select File → New → Project and in the following dialog window choose “.Net Framework 3,5” from drop list and below — “Class Library”.

It is important to use .Net Framework 3,5 for PTMC coding.

Create the coding environment for new plug-in in PTMC trading platform

2) Add references in Solution Explorer

Rightclick on References → Add Reference

 Add references in Solution Explorer

Browse for additional PTLRuntime.dll and Commons.dll files from the PTMC root folder (AppData\Roaming\ProtraderMC(xxbit)). These files basically introduce API and are crucial for PTMC add-ons functioning.

3) Create a user interface

As to define a plug-in's graphic view, add Form in Solution Explorer (rightclick on your Classname and select Add → Windows Form).

Add windows form for new user interface

Create a user interface using standard Visual Studio Designer. Lets add some button to perform actions with.

Create a user interface for "Hello world" plug-in in PTMC trading platform

To test and debug your plug-in, left click on button to create a Click Event then paste the message display code: MessageBox.Show (“Your text”).

test and debug the plug-in

4) Provide programmable logic to your plug-in

Continue working in your Form Class (not in Main). In order to create plug-in for PTMC terminal you must place attribute [Exportable] before your class declaration and implement IExternalComponent interface.

Write the programmable logic to your plug-in

This interface should contain information about your plug-in. Below is the list of properties and methods:


ComponentName

provides name of your future component, which would be used in terminal's tools menu

Content

sets control panel of user interface, which would be displayed in terminal

IconImage

sets Image for plug-in apart of content

PanelHeader

sets name of plug-in in tabs of terminal

Populate()

notifies about finished server connection and ability to use data from cache

Note: You must redefine IExternalComponent properties.

5) Compile and run your Plug-in

Compile application, then copy HelloWorld.dll file to Documents\ProtraderMC (xxbit)\My plug-ins. Now you can launch PTMC and find plug-in by going to Tools Pro Panels section in main menu.

Compile and run your Plug-in

Worth to note that Plug-in's updates would take an effect once terminal starts.

"Hello world" plugin has been launched in PTMC trading platform

For debugging purposes return to Visual Studio menu Debug → Attach to Process, then select process netclient.exe.

Note: keep your PTMC client live with running plug-in

While in debugging mode try to place breakpoint at testButton_Click () and study step by step how the code runs and behaves by triggering button in terminal.

Debugging process in PTMC trading platform

Recap

This simple guide partialy unveils PTMC's API unlimited possibilities for building your successful winning strategy and we hope you feel like to try out more. Have fun and unleash your ideas with happy coding!


Have not tried PTMC yet? There is no better way to boost knowledge than to use it! Start trading with PTMC now!

Discussion
Join PTMC community to post your comments
  • Williams Chris 08.07.2016
  • AminderG 09.07.2016
  • AminderG 09.07.2016
  • AminderG 22.07.2016
  • Burhay Vlad 01.02.2017
  • Claudecir Santos 23.11.2017
  • Samuel Gui 27.03.2019
PTMC is a professional trading platform that combines all the best charting and analytical tools to trade on different financial markets. It is developed by PFSOFT UK LTD, a global provider of trading technology for banks & brokers
© 2024. PTMC is based on Protrader technology
PFSOFT UK LTD
71-75, Shelton Street,
Covent Garden,
London, WC2H9SQ,
United Kingdom
Support & Development
PFSOFT Ukraine
Office #701
Mechnikova Street, 10B
49000, Dnipro, Ukraine
Contact us
Phone: +380 56 740 30 01
E-mail: info@protrader.org
Skype: PTMC_support
Find more ways to contact
Join us in social networks