Be connected. How to integrate PTMC with your broker

Hey there!

We are glad to present to the community our new Integration API. It’s a set of classes and methods, which allows you to integrate PTMC platform with any broker or data provider by yourself. All you need are notions of trading and C# language. This is the first version of our Integration API, and we plan to extend and develop its opportunities with taking into account users’ desires. That’s why we appreciate your ideas and remarks.

From the technical point, the integration consists in main methods realization, necessary for cooperation between the platform and a broker or a data provider: connection, order placement, history reception. Feel free to use any broker API in your integration, like REST, FIX, any proprietary protocols: there are no restrictions, everything depends upon your own preferences and broker’s data.

We are going to show you the opportunities of Integration API via viewing the real example of integration with new v20 REST API from Oanda. Information about this API is available on their official web site. The main emphasis in this article will be on Integration API, but in case you are interested in discovering full details of cooperation between PTMC and Oanda, see the source code in GitHub.

Preparation

First, execute the following steps:

Create a dynamic library project in your development environment

Add a link to PlatformAPI.dll from PTMC terminal installation path

Describe inheritor from the class Vendor and override necessary methods.

To test the integration, place your library and all other ones bound to it in the folder of terminal location. After this, it will be available in the vendors list in the window “Connection settings”.

Now everything is ready to start work. Let’s go!

Connection

Work with any integration begins with mechanisms of connection to a broker adjustment. The API has the method Connect, and its realization makes your PTMC platform work with a broker or a data provider. Sometimes you may need additional settings, like an account type, demo or real. They are available in the terminal’s “Connection settings” window:

GetConnectionParameters method defines which settings the integration requires. In our case with Oanda we provide opportunity of choosing a connection type:

Accounts and rules

Account is one of the clue objects, necessary for a correct platform’s work, that’s why our next step is a GetAccounts method overriding. This way we return information concerning all available accounts with actual data to the logged in user. They become visible to the user in the terminal for getting reports, for trading, data filtration, etc:

PTMC platform represents a large set of functions, which assure work with all assets: futures, options, stocks, forex. If a particular integration doesn’t provide a necessary data set, like Level2 quotes or tick history, you can hide unnecessary functions. Use GetRulesTable method for this:

Trading instruments

These trading objects are necessary for a trader to view history, to trade, get quotes and so on. You can specify all instruments, available at the moment of connection, and information about them in GetInstruments method. This mechanism is similar to getting accounts. Actually, the bigger part of the API works in accordance with this principle: the terminal requests data from a vendor, and it should be provided.

Subscription to quotes

After adding an instrument to a panel, like Watchlist or Market Depth, a user expects to see its quotes. For this realize SubscribeSymbol and UnSubscribeSymbol methods to see quotes for the instrument. As a parameter we get an instrument name to subscribe to and one of quotes types: Level1, Level2 or Trade. Oanda v20 provides only Level1 and Level2:

Orders, positions, trades

Positions, orders and trades are standard entities that provide data for trading platforms and usually related to an account and an instrument. That’s why it is logically to realize entities of account and instrument, then add maintenance of positions, orders and trades. A set of methods GetPendingOrders, GetPositions, GetTradesHistory allows a trader to view respective information in corresponding panels. The platform calls these methods and data right after a successful connection:

Additionally, there is a set of methods to report on user’s portfolio changes to the terminal. These changes can be position opening, order cancellation or modification, etc. A set of such methods includes OnOrderUpdated, OnOrderCancelled, OnPositionUpdated, OnPositionClosed.

History loading

Stepwise we reached chart and history loading. LoadTickHistory and LoadBarHistory are the main methods to define how and where to upload tick and bar history from. Oanda doesn’t provide tick history, that’s why we use only LoadBarHistory method. We get HistoryRequestParameters object as an incoming parameter to indicate which instrument, period and interval the user requested history for. This way we return a bars array to be displayed on the chart:

Trading operations

Our API allows to integrate PTMC platform with any data feed as well as with any broker, providing a trading interface. Such panels and functions, as Order Entry, Visual Trading from the chart, order cancellation or modification will work correctly if you realize a particular set of methods. The main one in the set is PlaceOrder method. Correctly process the incoming parameters from OrderParameters object and send an order placement request to a broker:

There are also methods for opened orders and positions management: ModifyOrder, CancelOrder, ClosePosition.

Reports

It happens, the API provides one or several reports. You can allow the user to view them in the platform. Start with a general list of available reports definition and their required parameters, for example, an account or a report period. Use GetReportsMetaData for this:

Next, define the mechanism of particular report’s generation. As parameters, you get a report name and parameters which are set by the user. This results into Report object, represented in the form of table, a set of columns, rows and cells with values:

Conclusion

In this article we have covered the clue methods for PTMC platform integration. We haven’t described some additional methods, because they are simple and work in the similar way to the described ones do. We haven’t touched some peculiarities, just because Oanda is a Forex broker. These are Trade quotes, instrument search by pattern, work with options. We are going to realize new exchange integrations with Metastock and QuoteMedia, and to view the peculiarities using one of them as an example.

Make you own integrations and be brave to share your results in our codebase. Our technical support is here to help you, contact our LiveChat or email us to info@protrader.org

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

Referral Program Agreement

Referral Program Agreement (henceforth referred to as “the Agreement”, “Referral Agreement”) is made between PTMC (henceforth referred to as “the Company”) and Referral Partner (henceforth referred to as “Referral Partner” or “the Partner”).
Terms and conditions of the present Agreement are binding for the Company and for the Referral Partner.

The Agreement contains all the terms and conditions that shall regulate relations between the Company and the Referral Partner.

The Agreement shall enter into effect as soon as the Referral Partner registers on the PTMC official website and shall remain valid until the termination of the Agreement.

Please note that the Company reserves the right to revise, modify, change or remove clauses of the Agreement at any time at its sole discretion. Please check periodically terms and conditions of this Agreement on the Company website.

The Company reserves the right to reject the registration of any entity or person in the PTMC Referral program including the case if such entity is a person suspected of fraudulent activities фе its sole discretion.

1. General Terms

1.1. The Company and the Referral Partner agree and accept the obligations under the Agreement.

1.2. The Referral Partner undertakes rights and obligations set forth hereinafter. The Referral Partner agrees to acquire users to the Company acting in his name.

1.3. The Referral Partner acknowledges that all the users acquired to the Company are the Clients of the Company.

1.4. The Agreement is written in English language. The Company may provide the Сlient with the translation of the Agreement into the needed language on demand. English version of this Agreement is to be of prior importance. The translation may be provided only for the convenience of the Сlient.

1.5. To become an Referral Partner a user must:

1.5.1. Register on the Company website PROTRADER.ORG.

1.5.2. After the registration on the PTMC official website the Referral Partner receives an individual unique referral link which is available in user profile.

1.6. The Company has the right to request confirmation of any information provided by the Referral Partner during the registration.

1.6.1. When the information provided by the Referral Partner during the registration is changing, the Referral Partner should inform the Company about such modifications and request the Company to update the data.

1.7. After the Referral Partner accepts terms and conditions of the Agreement, he/she has the right to:

1.7.1. Conduct advertising campaigns in the interest of the Company.

1.7.2. Introduce marketing and advertising campaigns with the aim to acquire new Clients to the Company, provided that such events are legal in the country where they are conducted.

1.7.3. Provide the Clients with the necessary information about the Company, including the Company contact information, as well as general conditions of the services provided.

1.7.4. The Referral Partner has the right to use promotional materials provided by the Company representatives, they are: banners, text links, landing pages etc. The Referral Partner may use banners with the Company logo provided by PTMC and/or his personal referral link.

2. Rights and obligations of the Referral Partner

2.1. By registering on the official PTMC website the Referral Partner confirms that he/she accepts all the terms and conditions set out in the present Agreement. The Referral Partner acknowledges the fact that the Company has a right to modify the terms and conditions of the Agreement unilaterally.

2.2. The Referral Partner agrees to acquire new Clients to the Company under the present terms and conditions set by the Company.

2.3. The Referral Partner accepts terms and conditions regarding funds withdrawal and commissions charged that are specified in the Client Agreement.

2.4. It is prohibited to the Referral Partner to use any fraudulent methods, such as threatening, blackmailing etc. to attract new Clients to the Company.

2.5. The Referral Partner is obliged to get acquainted with the services provided by the Company on his own and inform the Clients he/she has acquired/is going to acquire about important changes in time.

2.6. The Referral Partner is obliged to warn the Client about the risks of currency trading on the foreign exchange market.

2.7. The Referral Partner is obliged to solve the problems the Client may face with while trading on the foreign exchange market. In case if the Referral Partner does not achieve to solve the above mentioned problems on his own, the Referral Partner is obliged to contact the Company and represent the necessary details.

2.8. The Referral Partner shall not give any recommendations or advice to the Client related to trading operations on the market. The Company shall not be responsible for the consequences of such recommendations and advice

2.9. The Referral Partner is not permitted to conduct trading operations on the account of the Client he has acquired.

2.10. It is prohibited to the Referral Partner to get referral revenue from his own accounts and those owned by his close relatives in case if the partner is an individual; as well as from private accounts of founders or accounts of their close relatives in case if the partner is a legal entity.

2.11. In case it is detected that the Referral Partner uses documents of the third parties with the aim to get referral revenue, the Company has the right to block all such accounts including personal account of this Referral Partner without any right of further renewal.

2.12. The Referral Partner shall not disclose the information received from the Company during the collaboration period and the data the containing in the Agreement to any third parties.

2.13. It is forbidden to the Referral Partner to use the following types of advertisement:

2.13.1. Advertisement on websites that contradict the laws of the country where the Referral Partner is located.

2.13.2. Advertisement on websites content of which is contrary to current legislation, morality, public order, good faith or is defamatory, aggressive, obscene, offensive, violent or incites violence, racist or xenophobic, or in general which is illegal or violates a person's rights and/or physical and/or moral integrity.

2.13.3. Spam mailing.

2.13.4. Advertisement with the false information contained.

2.13.5. Any other advertising that may affect credibility or reputation of the Company or any other dishonest marketing methods.

2.14. It is prohibited to the Referral Partner to organize monetary relations with the Clients (including receiving money, payment or banking cards, etc.).

2.15. The Referral Partner certifies and agrees that he shall act in accordance with all the applicable Anti-Money Laundering laws.

2.16. The Referral Partner is obliged to inform the Client of the need to protect security and confidentiality of account and login information and of the necessity not to disclose such information to any third parties. The Company shall not be responsible for the unauthorized use of the Client account information by any third parties.

2.17. The Referral Partner shall be responsible for the accuracy of the Client registration form and the authenticity of the data provided by the Client.

2.18. The Referral Partner allows the Company to use contact information provided during the registration, such as email address and other information specified in order to send the letters and proposals.

2.19. The Referral Partner agrees that the Company may unilaterally terminate and change terms and conditions of the Agreement without any explanations.

2.20. The Referral Partner is not entitled to: publish any negative comments (essays, letters) concerning the Company in any newspapers, magazines or other periodicals, blogs, Internet forums or other web-resources that may affect credibility or reputation of the Company. If the Referral Partner uses his own web-resource in order to attract clients to the Company, the content of the web-resource regarding the Company shall be approved by the Company.

2.21. If the Company detects that the Referral Partner has been involved in activities described in clause 2.20 of the Agreement, the Company is entitled to reject the Referral Partner request for funds withdrawal and to block his account, as well as inform the regulatory authorities of the jurisdiction of the Referral Partner.

2.22. It is prohibited to the Referral Partner to use PTMC brands in any way or manner whatsoever, including but not limited to the words “PTMC” spelled in any possible way (including with typos, spaces, signs, symbols or in any other way). Such forbidden use of the PTMC brands includes the use of such words/trademarks in the referral advertisements or in any part therewith, in the displayed URL and/or in the destination URL.

2.23. The Referral Partner shall only deal with third parties as a client of the Company. The Referral Partner shall not use the Company name, Company logo, etc. anywhere, including promotional materials, letterhead and business cards, advertisements and publications without the Company’s prior consent, with the exception of the case described in clause 1.8.4. of the Agreement.

2.24. The Referral Partner shall respect the confidentiality of the Company business and it is prohibited to him/her to disclose any confidential information or any information concerned the Company business for five years after termination or cancellation of the Agreement.

2.25. The Referral Partner guarantees the precise performance of the above mentioned obligations.

3. Rights and obligations of the acquired Clients

3.1. A user shall be considered as acquired by the Referral Partner after it is registered on the official PTMC website by following the unique link of the Referral Partner.

3.2. A client shall be considered as the acquired by the Referral Partner under the condition that the Client has not be previously registered as the client of the Company.

3.3. The Referral Partner shall not be entitled to refer his close relatives in case if the Referral Partner is an individual; or close relatives of the founders in case if the Referral Partner is a legal entity. The Referral Partner shall not be entitled to refer his own accounts.

3.4. Account owned by the Referral Partner and those owned by his close relatives if the partner is an individual, as well as private accounts of founders or accounts of their close relatives if the partner is a legal entity shall not be considered as those that the Referral Partner has acquired.

3.5. Accounts detected to be registered by the Referral Partner himself in order to get money through dishonest means shall not be considered as those that the Referral Partner has acquired. In case if such violation of the terms and conditions is detected the Company is entitled to terminate the Agreement and to block the Referral Partner account.

3.6. The Referral Partner himself, his relatives or any other affiliated parties shall not be considered as the Clients acquired by the Referral Partner. In case if any data of the Referral Partner coincides with the data provided by any acquired Client (such as ID data, address, telephone number, email address, IP address, etc.), such Client shall not be considered as the acquired one and shall be removed from the Referral Partner list. In such a case the referral revenue credited for this Client will not be paid.

3.7. Should the IP address of the Client be the same as that of the Referral Partner then they shall be considered affiliated and the referral revenue credited for this Client will not be paid.

4. Rights and obligations of the Company

4.1. In case if the Referral Partner fails to perform any obligations under the Agreement, the Company is entitled to terminate this Agreement.

4.2. The Company reserves the right to take legal actions against the Referral Partner in case the Referral Partner attempts to manipulate the Company and/or the Company proprietary trading platform and/or abuse the Referral Program. The Company reserves the right to withhold and/or deduct from any payment to the Referral Partner in the event of such manipulation and/or abuse.

4.3. The Company reserves the right under its sole discretion to reject the registration of any entity or person to the Referral Partner, including the case if such entity is involved in fraudulent activities.

4.4. If the Referral Partner appears to belong to one of the categories described in clause 4.3 the Company is entitled to terminate the Agreement and to block the Referral Partner account.

4.5. If any activity conducted by the Referral Partner is contrary to international law, morality, public order, good faith etc., the Company has a right to terminate the Agreement and to block the Referral Partner account.

4.6. The Company shall pay referral revenue to the Referral Partners after the Company receives payments for the software license paid by the acquired Clients.

4.7. The Company shall provide the software paid by the acquired user after the fact the payment has been carried out.

4.8. The Company shall enable Clients to conduct trading operations using PTMC software by providing them with logins and passwords to the trading terminal.

4.9. The Company maintains records of all trading operations made by the Clients.

4.10. In case if the Referral Partner fails to perform any obligations under the present Agreement, the Company has a right to exclude Clients from his list of the Clients acquired by him/her.

4.11. The Company is responsible for calculations of the referral revenue. In case if the Referral Partner wishes to check the calculations, the Referral Partner may request his Clients to provide the necessary statements. The Company shall not provide Referral Partners with the payment statements of the Clients.

4.12. The Company agrees to pay referral revenue to the Referral Partner in accordance with Appendix 1 of the present Agreement.

4.13. The Company determines method of the referral revenue calculation at its sole discretion.

4.14. In case if revenue is charged for the allegedly fraudulent accounts the Company reserves the right to cancel the revenues from such accounts and exclude such Referral Partners from the Referral Program.

4.15. Neither Party hereof shall be held liable for the complete or partial failure to fulfill its obligations in case if this failure results from Acts of God (including but not limited to fire, earthquake and other natural disasters, war or other military operations, blockades, government regulations and other extraordinary and unavoidable circumstances beyond either Party’s control).

4.16. Under the above mentioned circumstances the Party that fails to fulfill its obligations is obliged to inform the other Party through written notification within five business days from the moment of their onset and cessation.

Appendix 1. Referral revenue calculation

The Company shall pay the Referral Partner percentage in the amount from 10% up to 30% from the software license payments carried out by the Clients acquired by the Referral Partner.

The equivalent of the above mentioned referral revenue is calculated immediately as soon as the acquired client pays for the software and displayed in the user profile of the Client on the official PTMC website.

The Company shall pay the Referral Partner a certain percentage from 10% to 30% from the software license payments. This percentage is determined by the total number of the Clients acquired to the Company by the Referral Partner. The percentage is calculated according to the table attached below.

Crediting of the referral revenue shall be made on a monthly basis and shall be calculated within the first 10 days of each calendar month.

Any other payments are possible only in case if the Company and the Referral Partner agreed it in an amendment agreement.

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