ATcl Beta 2 - now with Tk GUI

ATcl Beta 2 - now with Tk GUI

16 May 2018, 17:38
Maxim Kuznetsov
0
141

I am glad to present a new version of ATcl. Work was continued on the unification and simplification of the API, it was possible to achieve stable work of Tk in the experts. Demos replenished with two useful demonstrations.

About ATcl

The ATcl library provides a compact API for the full use of Tcl:

  • You can use in any MQL program: script, indicator or expert
  • in one program multiple interpreters can be used, including Safe
  • simple conversion of Mql data types to Tcl objects and back. (string, long, double)
  • similarly supports arrays and Mql series
  • management of Tcl objects - creation, deletion, duplication, obtaining of nested elements
  • creating, reading, installing, and deleting variables and hashes for Tcl
  • execution of Tcl scripts and procedures
  • Object design - the library is represented by a class
  • It's easy to install - just unpack the archive

Expand the capabilities of your MQL programs, use DBMS, supplement with network tools, integrate them with any programs using Tcl.

Original ATcl site is http://nektomk.ru/en:atcl:start

Partial duplicated in SourceForge: https://sourceforge.net/projects/mt-atcl/

In new version

API

The syntax of the Set methods is changed - they always take the immediate MQL value as parameters. In order to assign a Tcl_Obj object to the variable, the SetObj method (varName, obj) was introduced. As the development of similar changes affect other methods.

Directory structure

The tcl scripts are moved to the Libraries / ATcl / demo directory The distribution includes the Cawt library (http://www.cawt.tcl3d.org/)

Full featured GUI

Finally earned Tk. Now experts can do complex GUI without any problems.

ATcl - Tk GUI

ATcl - Tk GUI 2

Demo - WebSocket

Made a demo showing the operation of a websockets. Following screen shows two indicators with ATcl - read and parse MQL5.com site and subscribe to binance.com websocket

ATcl - WebSocket and parsing web

Demo - CawtExcel

Demo showing the mutual exchange of data between MQL and Excel. It turned out a «universal» indicator.

ATcl - Cawt Excel

Beta version (known bug)

- at the last moment it was detected: there is a conflict while simultaneously loading one ATcl indicator chart and an adviser using Tk. The nature of the error is understandable, but in the code it is not yet lozirovana and therefore has not yet been corrected.

Separately, they all work fine, so although with a delay but decided to release a release with this bug.
.


MQL application template using ATcl

//--- input parameters
input int      MAGIC=0;

#include <ATcl/ATcl.mqh>

ATcl *tcl=NULL;
bool hasTimer=false;

#define TIMER_MSC 100
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
// reset global vars. to defaults
   tcl=NULL;
   hasTimer=false;
// initialize ATcl library and create interp.
   if(ATcl_OnInit()!=INIT_SUCCEEDED || (tcl=new ATcl)==NULL || !tcl.Ready()) 
     {
      return INIT_FAILED;
     }
// start timer
   hasTimer=EventSetMillisecondTimer(TIMER_MSC);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
// stop timer
   if(hasTimer) EventKillTimer();
   if(tcl!=NULL) 
     {
      // unref refferred objects
      // delete interp.
      delete tcl;
     }
// finalize library
   ATcl_OnDeinit(reason);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   if(!hasTimer) 
     {
      tcl.Update();
      hasTimer=EventSetMillisecondTimer(TIMER_MSC);
     }
   return(rates_total);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTimer()
  {
   tcl.Update();
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   tcl.Update();
  }
//+------------------------------------------------------------------+

Project development

There were problems with the old domain and ATcl moved to my personal domain; To avoid problems with the availability of the distribution, the files will be duplicated on SourceForge https://sourceforge.net/projects/mt-atcl/. There you can leave feedback, requests and requests

The project is distributed free of charge, without licensing restrictions and you can help its development with a coin donate

Download

The distribution is available on the install download page and on SourceForge https://sourceforge.net/projects/mt-atcl/files

Intermediate versions are also posted as you go to the mql5.com forum: https://www.mql5.com/en/forum/224745 (russian language spoken)


The ATcl library is provided free of charge and without restrictions on the use

If you are interested in a project you can help financially

https://paypal.me/nektomk

other ways: donate

if possible, specify the features that are most interesting for you

In consequence of BAN, no orders through freelancing are possible,
now only exclusively through personal contacts in the profile.

and my products on the market are apparently suppressed in rotation,
but you can read them on the display: https://www.mql5.com/users/nektomk/seller



Files:
atcl.zip 6662 kb
Share it with friends: