How to use onTransaction when coding an EA

How to use onTransaction when coding an EA?
Any example?
I have looked for samples in Fintechee’s Github repo, but there are too many source files, I don’t know which can be a best practice.

onTransaction is a very special feature in our platform, other platforms have no similar feature.

Because Fintechee is a completely browser-based(WEB-based) platform, so all the programs are subject to async mode.
When you send an order, the program will not wait for the result of the order execution and it will return the control to the browser immediately.
The browser will continue to fetch the updated streaming quotes and render the chart.
If the control isn’t returned to the browser, then the screen of your browser will be blocked(This is sync mode, not applied in our platform because the performance is very low and the user experience is bad as well).
Once the notification about the transaction is received(the server sends the notification), the browser will trigger a callback function to deal with the notification(event). onTransaction is the callback function.
So, you can code what you want to do in this function.

We have two examples for you:

This is a difficult example because it will call some functions of a plugin for Oanda.

This is a simple example, please check this one to learn how to use onTransaction.

3 Likes

Thank you for your help!!