Asynchronous web requests for MetaTrader [closed] - algorithmic-trading

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am trying to see whether it is feasible to build a custom indicator for MetaTrader that can make asynchronous internet requests, in order to post data to a server with a PHP interface.
These requests might take some time for the webserver to process, so I am worried that they will block the indicator from continuously updating new tick data if they are performed in a synchronous manner.
Are there any asynchronous libraries available for MT4?

Yes, there are
MT4 can directly use ready-made bindings for great platform-to-platform & process-to-process messaging library, be it ZeroMQ or nanomsg.
Having used the former for several years, MQL4 processes can form a non-synchronised ( i.e. independently of a aMarketEVENT arrival a.k.a. quote, or less exact called also a "tick" ) ExpertAdvisor->script or script->script inter-process communication solutions, that allow to build a powerful augmented GUI services for professional trading and many other features for soft real-time systems & low intensity HFT clustering.
On the other hand, one may equip MT4 EA with a few indispensable services with this same messaging technology platform:
add an interactive remote-keyboard for a CLI alike interface to the running EA
add a remote ( non-blocking (!!) ) file-IO for the HFT services
add a remote / centralised syslog service for the ( non-blocking ) logging
add a remote / clusterised GPU-based AI/ML real-time models for advanced trading
Nota bene
From the design/architecture point of view, an MT4 indicator thread has certain limitations one shall be aware of.
An otherwise common POST-based publication to a php-process on a remote WebServer will definitely take much more than a few tens of milliseconds, that are causing an un-avoidable issue for the above asked formal achitecture.
One shall rather minimise all MT4.CustomIndicator-embedded part of the processing, so as to avoid the processing to slip behind the next aMarketEVENT arrival, thus to prevent a skew in synchronicity of calculated values.
This can be achieved by dispatching all the non-core functionalities "outside" of the scope of the MT4.CustomIndicator code ( using ZeroMQ process-to-process communication framework ) and solve all the rest of the logic in a different thread, outside of the MT4. The postprocessing is the least of the issue, the handshaking and values' update & retransmit logic are the focal point of the off-loading from the very fragile thread-synchronicity of the MT4 ( one may have observed this issue to become more and more dangerous in recent Builds. Many robust augmented GUI solutions start to suffer from choppy responsiveness in Builds post 7xx and required slight adaptation of their core real-time control loops to regain their UI-robustness and their smooth UI-responsivness under heavy loads )
Do not hesitate to ask for more details on this MQL4 or HFT or other subjects.

Related

Time/resource allocation on a Stylish vs. Functional user interface [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
When developing applications how much focus/time do you place on an application’s style vs. functionality. Battleship gray apps drive me insane. On the other hand maximizing a business application’s "style" can tax time and financial resources. Applications need to be appealing to resell or meet basic customer expectations, but defining a healthy medium can be difficult.
What would you say are reasonable
"standards" for allocating develop
time/resources should be dedicated to
stylizing a business application?
Is there any quasi-accurate method to justify
such items via ROI?
If you have customers, then customer service is key to your business objectives. Service starts when application development starts -- by spending more time planning and designing a truly great (beyond "stylish!") user interface and experience, you serve your customers better from the beginning. That investment, far from being draining on financial resources, will make your offerings more stable and are easier to support, resulting in lower costs, a happier and more productive workforce (people like taking pride in the software they create -- can you take pride in a soulless, battleship gray "enterprise" app?), and better customer loyalty.
The question isn't "what 'standard' amount of time must we spend on style," but "can we afford not to give the user's experience our full attention." If you aren't creating really great business apps, you're leaving money on the table for any competitor who is.
My opinion is that the first choice is to allocate some time & senior resources to provide technical guidance to find/adapt/create a GUI framework that will help to lower the cost of coding the UI.
Finding the right tool is crucial to match deadlines.
However, finding a common platform on which current and future projects can be built on is even a better choice (but needing more time to define & needing to have a clear sight on what will come after)
Designing GUIs is a mix of several skills (ergonomy,styling,programming) , so the team need to have at least some knowledge of all those skills to fullfill both customer functional requirements & also satisfying user experience (which is more ergonomy dependent than style dependent)
Unless your business application is "Rock Band Enterprise Edition" you should spend no time designing away from battleship gray. There is value in boring consistency.
Try to keep the app very close to the OS defaults, so no special colours or themes. System default colours/styles should be everywhere! Custom icons only when necessary (when there is no other icon that will do).
Further UI styling (fancy colour themes, skins, etc...) should be a separate sub-project and billed accordingly. Some clients will not want or care the extra styling (or want to pay), and some will demand it. For the ones that don't care, just give them OS defaults because once they realize it CAN be customized, they will want more but it's usually too late in the project to do that reasonably (unless you're a killer PM!).
For the ones that demand it, you might want to set up a separate project with the graphics designers, but hold off until the bulk of the functionality is complete. That way, you can just skin the app with the UI that the designer creates. Of course, that assumes that your UI framework is easily skinnable, so if it isn't you might want to look for one (Assuming this is a problem you anticipate).

Techniques to Reduce Complexity in Game Programming [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
In my spare time I program games as a hobby, different sorts of things and currently nothing very complex. Things likes 2d shooters, Tile-Based games, Puzzle Games, etc...
However as the development of these games goes on I find it becomes hard to manage the complexity of different subsystems within the games, things like Interface, World View/Model, Event Handling, States (Menu's, Pause, etc...), Special Effects and so on.
I attempt to keep the connections to a minimum and reduce coupling however many of these systems need to talk in one way or another that doesn't require holding your entire code-base in your head at one time.
Currently I try to delegate different subsystems and subsystem functions to different objects that are aggregated together however I haven't found a communication strategy that is decoupled enough.
What sort of techniques can I use to help me juggle all of these different subsystems and handle the complexity of an ever increasing system that needs to be modular enough to facilitate rapid requirements change?
I often find myself asking the same questions:
How do objects communicate with each other?
Where should the code that handles specific subsystems go?
How much of my code base should I have to think about at one time?
How can I reduce coupling between game entities?
Ah, if only there were a good answer to your question. Then game development wouldn't be nearly as difficult, risky, and time-consuming.
I attempt to keep the connections to a
minimum and reduce coupling however
many of these systems need to talk in
one way or another that doesn't
require holding your entire code-base
in your head at one time.
They do, but often they don't need to talk in quite as direct a way as people first believe. For example, it's common to have the game state push values into its GUI whenever something changes. If instead you can just store values and let the GUI query them (perhaps via an observer pattern), you have then removed all GUI references from the game state. Often it's enough to simply ask whether a subsystem can pull the information it needs from a simple interface instead of having to push the data in.
How do objects communicate with each other?
Where should the code that handles specific subsystems go?
How much of my code base should I have to think about at one time?
How can I reduce coupling between game entities?
None of this is really specific to games, but it's a problem that arises often with games because there are so many disparate subsystems that we've not yet developed standard approaches to. If you take web development then there are really just a small number of established paradigms: the "one template/code file per URI" of something like PHP, or maybe the "model/view-template/controller" approach of RoR, Django, plus a couple of others. But for games, everybody is rolling their own.
But one thing is clear: you can't solve the problem by asking 'How do objects communicate'. There are many different types of object and they require different approaches. Don't try and find one global solution to fit every part of your game - input, networking, audio, physics, artificial intelligence, rendering, serialisation - it's not going to happen. If you try to write any application by trying to come up with a perfect IObject interface that will suit every purpose then you'll fail. Solve individual problems first and then look for the commonality, refactoring as you go. Your code must first be usable before it can be even considered to be reusable.
Game subsystems live at whatever level they need to, no higher. Typically I have a top level App, which owns the Graphics, Sound, Input, and Game objects (among others). The Game object owns the Map or World, the Players, the non-players, the things that define those objects, etc.
Distinct game states can be a bit tricky but they're actually not as important as people assume they are. Pause can be coded as a boolean which, when set, simply disables AI/physics updates. Menus can be coded as simple GUI overlays. So your 'menu state' merely becomes a case of pausing the game and showing the menu, and unpausing the game when the menu is closed - no explicit state management required.
Reducing coupling between game entities is pretty easy, again as long as you don't have an amorphous idea of what a game entity is that leads to everything needing to potentially talk to everything. Game characters typically live within a Map or a World, which is essentially a spatial database (among other things) and can ask the World to tell it about nearby characters and objects, without ever needing to hold direct references to them.
Overall though you just have to use good software development rules for your code. The main thing is to keep interfaces small, simple, and focused on one and only one aspect. Loose coupling and the ability to focus on smaller areas of the code flows naturally from that.

How would you use AGILE here? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am a big proponent of agile, but a friend of mine (who doesn't know agile yet - hes a managerial type ^^) asked me how I would go about planning and developing a complex distributed project, with a database layer, comms layer, interface, and integration into embedded devices.
The agile method emphasises the concept of releasing early and iterating, but in the scenario of a project with many inter-connected components that all need to be functional for the whole thing to work, it would be difficult to release an early version without working on all the components. How would agile help my friend here? How best would he utilize it?
Teams in my company face the same types of problems. We are building projects with a large number of moving parts and architectural layers that make it difficult to create a working product early on. Additionally, there are often specialty resources that need to be scheduled or slightly out of synch with the team. Some approaches we've taken are below It has been challenging, but these approaches seem to be helping.
Build as vertically as possible
In other words, strive to have something working, end to end as quickly as possible. We typically get there a few sprints in on a 9-16 month project.
You'll often find a significant number of layers can be mocked or held back.
Often, the initial customer facing components are place holders. We create a limited bit of functionality that is something like what the customer wants, but is likely to be very different in the final project. This allows us to prove the rest of the product at a system level and provide visibility from a system perspective.
Separate base architecture from the product
Our early sprints are often centered around infrastructure/architecture. For example, threading subsystems, performance monitoring, communications and test frameworks.
Treat the subsystems as separate deliverables
Fully define each subsystem
Complete (truly complete, not just a partial implementation) each subsystem
Load test each subsystem within the context of how it will be used in the final product
Make your first iteration to be dedicated to architectural design, including the identification of the necessary components and the definition of the relationships and communications between them.
Once you have a clear picture of how the components interact, build the skeleton of each one. That is, implement "stub" components that just have the communication part on place, and the rest of the functionnality just do nothing or return test data. Have an interation dedicated to this task (including testing the component communication mechanisms) as well.
Then you can plan iterations to fully develop each component in the appropriate order, so that the system can grow in a ordered way.
TDD - iterate with incomplete parts after writing tests. Mock the bits that aren't ready. Sounds exciting.
It is unlikely that each layer needs to be complete for it to be usable by the other layers - for example the persistence layer could just serialize objects to a file initially, and converted to use a database when the need arises. I would look at implementing the minimum of each layer needed by the initial stories and fleshed out to add functionality as the the system grows.
Growing a system this way means you only implement the functionality you need, rather than all the functionality you think you may need at some indeterminate time in the future.
If you cannot break the large project into smaller parts that are useful (i.e. enable some use cases) on their own, agile probably won't help you that much in this project. You can pick some techniques like pair programming, refactoring etc. but the overall planning has do be done in a conventional way.

How to organize team resources with ever changing clients / project requirements [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
We have a pool of technical resources consisting of some front end developers, back end developers, graphic designers. Those resources are separated from clients directly by one or two account people per client.
Requests from clients come in through the account people and get sent to our synchronization manager. The synchronization manager keeps track of all client projects and has a basic idea of the workload for each resource. His job is to assign work to resources based on priority of the project and the resource's familiarity with the project (to some degree). Currently, the majority of this data/logic is handled in a complex excel spreadsheet. We revisit the schedule every week on Monday so that people have a clear idea of what lies ahead for them.
This type of system works ok for linear projects that have a longer duration, but starts to fail when there are lots of little projects/tasks happening concurrently. Many times, tech resources are "lost" when updates come to the schedule mid week. Not to mention when there are "urgent" requests that supersede the existing schedule.
How do you handle assigning workload when you work with multiple clients on a daily/weekly basis? Is there any software that you recommend to help with scheduling / determining resource availability? Please keep in mind that priorities and projects change frequently, with us not really knowing what is going to happen 1-2 weeks out from the present.
Sounds to me like the classic consulting conundrum: hitting that sweet spot where the fewest resources generate the most revenue.
The first question that comes to my mind is: how much pain is this causing? Grumbling from amongst the developers? Complaints from upper management? Furious clients? The solution should match the level of trouble caused.
The simple fact that you can't know the unknowable when it comes to schedule interruptions means that, in large part, there is no software fix to this problem. You have to build in enough room for those unexpected demands ahead of time and be ready to reassign on the fly.
It also bears mentioning that the seat-of-your-pants model, in which developers jump every time a client says boo, is a choice. It doesn't necessarily have to be that way if everyone is willing to consider other options.
Use an issue tracker such as JIRA
Personally I would take a look at using a Scrum board. This can be accomplished with a physical wall, PowerPoint slides, or Bugzilla.
Try the following:
1. Assign each tech to a cell
2. Assign each tech x amount of job/task give each job/task a priority level.
3. In the slide/wall create your different stages of To Do, Test, Very, Done and have the developers move them across the stages to give greater visibility of the tech and the projects.

What is your choice for a Time Managment Solution? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I've come across a few different applications that monitor my usage while on the computer, but what have you used, and like? whether it be writing down your activities in a composition notbook or install an app that reports silently to a server? what do you like?
For explicit time tracking for projects I use SlimTimer. I also run RescueTime to track my time implicitly, but I end up not looking at that data very often.
I use neomem to keep track of things by hand. This allows me to keep track of more than just time. I often keeps notes associated with the story. This has become a collection of knowledge that I often search.
I use a paper timesheet to track my time. It looks like this:
(source: redbitbluebit.com)
and as a back up, I use a paid version the excellent TimeSnapper in case I need to go back and retrace anything I missed tracking the time on.
I prefer writing the times down using pen and paper. That way you can more fairly weigh things that would have been miscalculated if you were recording them with a stopwatch or timer.
If you start on something and have to get up for a few minutes, a timer may count that toward your working time had you neglected to stop or pause the timer. The good-old pen and paper are going to more accurately show which tasks you focused most of your time and energy on...not just the ones that you started earliest and ended latest. It may not be 100% accurate, but neither is the timer if you don't use it properly.
I have used both in the past, and find that there are problems with both, but I prefer the pen and paper method.
We use Standard Time as a Time Tracking tool and it's got a nice quick tasks window that is relatively small and lets you easily click checkboxes to switch between tasks. You can also create projects/customers and pre-set tasks to be loaded for each project (development, unit testing, documentation, etc...) and then just use the quick tasks window to switch which task you are currently working on without wasting too much time going through a full blown GUI.
It's not cheap - about $150/user - so if it's for personal use it might not be the best bet, but if you're looking for a solution for a team of developers then I've found it to be a good fit.
I use the time tracker plugin on Firefox. It tracks my surfing time of the whole day
I've been using Toggl for about a year now and I've found it to be spot on. It's simple to use and allows you to perform basic reporting against various criteria. You can either input time entries manually or use a stopwatch timer utility.
I tried out several applications before I settled on Toggl. For me, the intuitiveness of the Toggl interface was what decided it. I like my productivity applications to get out of my way and let me do my job and Toggl does just that.
There are various pricing plans, including a free one.

Resources