Category Other  Published on 20/06/2024

Custom Frame Plugin

Description

Example used in


using System;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo.Plugins
{
    [Plugin(AccessRights = AccessRights.None)]
    public class MyCustomFrameExample : Plugin
    {
        WebView _cTraderWebView = new WebView();
        WebView _cTraderWebViewSite;
        
        protected override void OnStart()
        {  
            _cTraderWebView.Loaded += DisplayForum;
            
            var webViewFrame = ChartManager.AddCustomFrame("Forum");
            webViewFrame.Child = _cTraderWebView;
            webViewFrame.ChartContainer.Mode = ChartMode.Multi;
            webViewFrame.Attach();
            
             _cTraderWebViewSite = new WebView();
            _cTraderWebViewSite.Loaded += DisplayForumSite;
            
            var webViewFrameSite = ChartManager.AddCustomFrame("Site");
            webViewFrameSite.Child = _cTraderWebViewSite;
            webViewFrameSite.ChartContainer.Mode = ChartMode.Single;
            webViewFrameSite.Attach();
        }
        
        private void DisplayForum(WebViewLoadedEventArgs args) 
        {
            _cTraderWebView.NavigateAsync("https://www.spotware.com");
        }
        
        private void DisplayForumSite(WebViewLoadedEventArgs args) 
        {
            _cTraderWebView.NavigateAsync("https://www.ctrader.com");
        }

        protected override void OnStop()
        {
            // Handle Plugin stop here
        }
    }        
}

Spotware's avatar
Spotware

Joined on 23.09.2013

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: My Custom Frame Example_withSourceCode.algo
  • Rating: 0
  • Installs: 404
  • Modified: 20/06/2024 10:22
Comments
Log in to add a comment.
No comments found.