Traders often strive to keep websites with important trading and technical analysis information as close as possible to the charts. Plugins empower them to achieve this through custom frames.
In this article and its corresponding video, we will show you how to create custom frames that can house websites and textboxes using a plugin.
Create a custom frame showing a website
We will create a custom frame in the charts area to house a website.
Go to the Algo app and switch to the Plugins tab. Click the New button to create a new plugin. Tick the Blank option. Give your plugin a name, such as "My Custom Frame Example", and click the Create button.
When the code editor appears, initialise a WebView object.
1
_cTraderWebView=newWebView();
Subscribe to the WebView loaded event.
1
_cTraderWebView.Loaded+=_cTraderWebView_Loaded;
Set the cTrader Forum as the website in the WebView when it loads.
To build our plugin, use the Ctrl+B hotkeys or click the Build button.
To view the results, go to the Trade app. In our case, the cTrader Forum webpage is now displayed in our custom frame in the charts area.
Manage the custom frame
The custom frame housing the cTrader Forum website can be managed like any chart frame in cTrader. It can be detached and reattached to the chart area, resized, swapped or replaced with other charts.
Change the website URL
We will replace the cTrader Forum website with another webpage.
Return to the Algo app and edit the plugin code. Replace cTrader Forum URL (https://ctrader.com/forum) with Spotware URL (https://www.spotware.com).
Build the plugin again and go to the Trade app to view the changes. The Spotware website is now displayed on the custom frame.
Add multiple frames
We will update the plugin code to add two custom frames, each displaying a website. Add a new WebView object and repeat the code steps and lines from the previous example.
Build the plugin. When you return to the Algo app, you should see two websites (cTrader Forum and Spotware) in individual frames.
Create a text box
In addition to chart frames housing webpages, plugins allow you to add custom frames containing other objects. For example, you can add a frame that houses a text box.
Remove all the WebView code lines and add the following lines for a text box instead: