During coding and testing of my software I hit some issues with performance and wasn't able to find suitable answers here on the forum. Maybe the one or other could explain the behaviours that I run into:
SafeZone is a method for setting stops on the basis of recent volatility, outside the level of market noise. It is described in "Come into my Trading Room" book.
In a downtrend, SafeZone defines noise as the portion of the current bar that extends above the high of the previous bar, against the downtrend. It averages the noise level over a period of time and multiplies it by a trader-selected factor.
For short trades, it adds the average noise level, multiplied by a factor, to the latest hig
PipTick VSA is based on the original Volume Spread Analysis method. It was designed for quick and easy recognition of VSA patterns. Even though this indicator looks very simple, it is the most sophisticated tool that we've ever made. PipTick VSA indicator is a really powerful analytical tool that generates very reliable trading signals. Because it is very user friendly and understandable, it is suitable for every type of trader, regardless of his experience.
What is VSA?
VSA - Volume Spread An
The indicator has standard settings. The new modification of indicator provides special marking of the segment when the moving averages begin to form a cross in one direction or another. The Alligator`s cross indicates that the trend is about to change. Modified Alligator helps traders to determine a trend on a particular timeframe even if the averages are intertwined and have a shift in the future. Direction of a trend is determined by a cross of the averages with a specified marking area on th
TTMM – "Time To Make Money" – Time When Traders Makes Money on the Stock Exchanges
The ТТММ trade sessions indicator displays the following information:
Trade sessions: American, European, Asian and Pacific. (Note: Sessions are displayed on the previous five days and the current day only. The number of days may change depending on the holidays - they are not displayed in the terminals. The sessions are also not displayed on Saturday and Sunday).
The main trading hours of
VirtualTradePad is a panel for managing main orders in МetaТrader 5: Buy, Sell, Buy Stop, Buy Limit, Sell Stop, Sell Limit, Close, Delete, Modify, Trailing Stop.
This version is for informational purposes. Analyzing the main trade strategies using 10 indicators and 8 timeframes, the panel draws signal direction.
This pane is a part of the VirtualTradePad series that took 2-nd place in the Best Graphic Panel.
A free of charge demo version - VirtualTradePad Lite.
х - no s
Does not support hedging orders on a single symbol on MT5
MultiMTCopier MT5Source - new and improved multi-terminal positions copier for your real / demo account, works faster, requires less, flexible in managing and upgrading, new information support. This expert is designed for terminal MetaTrader5 from which the position will be copied.
The EA will copy all positions without delays Additionally integrated notification in situations requiring user attention Buttons for re
Pipfinite creates unique, high quality and affordable trading tools.
Our tools may or may not work for you, so we strongly suggest to try the Demo Version for MT4 first. Please test the indicator prior to purchasing to determine if it works for you.
We want your good reviews, so hurry up and test it for free...we hope you will find it useful.
Trend Laser with Volt Impulse
Strategy: Confirm impulsive signals Watch Video: (Click Here)Trend Laser with Energy Beam
Are you a swing trader? The PZ Swing Trading is the first indicator designed to detect swings in the direction of the trend and possible reversals. The indicator studies several price and time vectors to track the aggregate trend direction and finds situations in which the market is oversold or overbought and ready to correct.
Profit for market swings without getting whipsawed The indicator displays the trend direction at all times A colored price band represents the opportunity baseline C
This indicator allows you to enjoy the two most popular products for analyzing request volumes and market deals at a favorable price:
Actual Depth of Market Chart Actual Tick Footprint Volume ChartThis product combines the power of both indicators and is provided as a single file.
The functionality of Actual COMBO Depth of Market AND Tick Volume Chart is fully identical to the original indicators. You will enjoy the power of these two products combined into the single super-indicator!
The main purpose of the indicator is to determine and mark trade signals on the histogram of the Accelerator Oscillator, which were described by Bill Williams in his book "New Trading Dimensions". The list of signals:
The buy signal when the indicator histogram is below the zero line. The sell signal when the indicator histogram is below the zero line.The sell signal when the indicator histogram is above the zero line. The buy signal when the indicator histogram is above the zero line. The
Cluster analysis is now available in MetaTrader 5!
YuСlusters indicator builds a cluster graph based on tick data. For exchange instruments it is the volume and the last deal price, for Forex instruments it is the real or tick volume (depends on broker) and selectable type of the current price: Bid, Ask or (Bid+Ask)/2.
There are 5 criteria of cluster generation: Time interval, the criterion is set in seconds. Price range, the criterion is set in points. The current cluster is closed when the
The indicator calculates the actual status of your position on FORTS market. Since your position is re-calculated after each clearing on FORTS and other futures markets, you can see the status of your position on the chart and in the "Profit" section only starting from the last re-opening (clearing). The indicator solves this issue by displaying the level of the very first deal opening, the actual profit, swaps, and commissions. The product is most useful for mid-term and long-term deals on FORT
The main purpose of the indicator is to detect and mark trade signals on the histogram of the Awesome Oscillator according to the strategies "Trading Chaos, second edition" and "New Trading Dimensions".
The indicator detects and marks the following trade signals:
"Two peaks" - Divergence. The signal "Second wise-man" - third consequent bar of the Awesome Oscillator after its color is changed. The histogram crosses the zero line. The signal "Saucer".The indicator includes a signal block th
The trade strategy is based on three moving averages. To determine the trend, it uses three exponentially smoothed moving averages: FastEMA, MediumEMA and SlowEMA.
Buy signal: FastEMA>MediumEMA>SlowEMA (upward trend).Sell signal: FastEMA<MediumEMA<SlowEMA (downward trend).Input parameters:
Inp_Signal_ThreeEMA_FastPeriod = 8;Inp_Signal_ThreeEMA_MediumPeriod = 38;Inp_Signal_ThreeEMA_SlowPeriod = 48;Inp_Signal_ThreeEMA_StopLoss = 400;Inp_Signal_ThreeEMA_TakeProfit = 900;Inp_Money
A script for opening a grid of orders
If you need to quickly open several pending orders (Buy Limit, Sell Limit, Buy Stop, Sell Stop) on a certain distance from the current price, this script will do all the routine for you! Allow AutoTrading before running the script.
Run the script on a chart.
Language of messages displayed (EN, RU, DE, FR, ES) - language of the output messages (English, Russian, German, French, Spanish). Price for open - open price. If set to
qAutoActivation indicator is one of the main components of Trading Chaos Expert trading expert panel. The indicator displays the current trend on the current timeframe. This is the first indicator that is attached to the chart and saved in the trading complex template. It defines what trading signals from the expert panel should be automated for market entry (bullish or bearish ones).
When the trend changes, the indicator changes the line color and, at the same time, highlights the trading pane
Purpose and functions of the indicator
The indicator determines and marks the moments of trend change on a chart based on the theory of fractal levels breakdown on any time frames. If a breakdown based on all rules is real, the horizontal lines will appear on the chart with corresponding color. If there is an up trend, the line will be blue. In the descending trend the line will be red. The blue line is a strong support level, the trader should look for buying opportunities above this line. The
The Expert Advisor implements the classic "triangular arbitrage", which is successfully used by hedge funds.
Arbitrage refers to a class of neutral-market strategies, in which the profit or loss of open positions does not depend on the direction of the market movement as a whole.
In order to take profit, the EA exploits a weak spot of market makers - it utilizes the difficulty of combining cross rates of individual currency pairs.
The advantages of the strategy are the following:
Active Lines - a powerful professional tool for operations with lines on charts. Active Lines provides a wide range of actions for events when the price crosses lines. For example: notify, open/modify/close a position, place/remove pending orders. With Active Lines you can assign several tasks to one line, for each of which you can set individual trigger conditions, as well as conditions for re-activations and the number of possible activations.
Active Lines helps you easily organize various tr
The script is intended for automatic placing of Buy Stop pending orders, Stop Losses and Take Profits on the user specified levels.
Avoiding unwanted entering a long position in case of false hitting the level as a result of widening of the spread by a dealing center. Avoiding unwanted triggering of a Stop Loss in case a quote pierces a significant level (fractal) without further confirmation with the close price. Setting a necessary virtual order and entering the market in
FourAverage: A Breakthrough in Trend Identification
With evolving information technology and increasing number of market participants, financial markets get less and less analyzable using good old indicators. Common technical analysis tools, such as Moving Average or Stochastic alone, are not capable of identifying the trend direction or reversal.
Can a single indicator show the right direction of the future price, without changing its parameters over 14 years' history, while at the same time
The script allows users to easily close positions if their profit/loss reaches or exceeds a value specified in pips.
Please set slippage value first. Sometimes some positions do not close due to high volatility of the market. Please set larger slippage or restart the script.
The script is intended for automatic placing of Sell Stop pending orders, Stop Losses and Take Profits on the user specified levels. This script is not that useful as "Virtual pending buy stop", since short positions are opened as Bid price crosses the levels. Thus spread widening is not dangerous. Nevertheless, you need to have this script to prevent unwanted hitting of the Stop Loss levels.
Automation of the process of placing the Sell Stop pending orders, Stop Losses and T
This is an utility for automatic scaling of a chart and making at least 140 bars visible in it. This is necessary for a correct wave analysis according to the Bill Williams' strategy "Trading Chaos". The utility can be used on any timeframe available in МetaТrader 5.
It draws a vertical line through the first bar the calculation starts from. This line allows you to see the probable starting point of the wave sequence along with a sufficient number of bars displayed in the chart. It also makes t
Scalper with Automatic Parameter Setting
Would you like to have an Expert Advisor that could automatically calculate trade parameters and adjust to the current market situation?
We present you our new development for the Forex market. This is a tick scalper for МТ4 and МТ5 - TickSniper.
Trading with it is fully automated. Forget continuous monitoring - this Expert Advisor trades independently. Its settings have been optimized over the course of testing on our real accounts.
The indicator is intended for determining the spread and swap size, the distance for setting stop orders and stop losses from the current price allowed and the risk per 1 point in the deposit currency.
The indicator informs a trader about possible additional expenses and profits connected with transferring a position to the next trade session of the financial instrument. It also informs about the spread size and the distance of pending orders, stop loss and trailing from the current price. In a
Safe Automatic is a safe MetaТrader 5 trading robot working autonomously on a VPS server. The good results are achieved on EURUSD.
The EA applies modified versions of a trend-following strategy, half-pyramiding, scalping, Elliott Wave method and speculating trading with a deposit protection. The EA switches the strategies automatically. The program also takes the news calendar into account: the robot does not enter the market in a 10-minute interval before and after a news rel
This software has no equals in the world and represents a universal trade "console" covering trading signals, automated market entry, setting of Stop Loss and Take Profit, as well as Trailing Profit for multiple trades at the same time in a single open window. Intuitive control of the Expert Advisor in "three clicks" ensures a comprehensive use of all its functions on different computers, including tablets PCs.
Interacting with additional signal indicators that mark the chart to give a real mar
The Expert Advisor places pending orders above the high fractal and below the low fractal on the distance of "The point of creating order". When one of the orders triggers, the second is removed. Depending on the parameter "The number of orders in the series" the Expert Advisor works in two ways:
"The number of orders in the series" = 1
It is a breakthrough Expert Advisor. If the fractal broken through upwards, buy with fixed TakeProfit and StopLoss. If the fractal is br
Trading Chaos Expert Lite is a light version of Trading Chaos Expert. In the Lite version it is not possible to receive the table of trading signals, automatically place pending orders based on them and maintain open positions for multiple symbols at the same time in one window. Only the Current Chart mode is available. In all other features the panel is fully consistent with the basic version of the Expert Advisor.
This is, rather, a well thought out trader's assistant which is not easy to do
Using a moving average indicator as an example
If it is on a H1 chart, it does its calculations using data from the H1 chart
If the chart is chaged to H4, it will do the same calculations but using the data from the H4 chart
The indicator is no longer doing anything with the H1 data.
Thank you for your explaination. Though I wish this would have been officially written down somewhere. The performance bottlenecks could be avoided that way. Because of lack of information and documentation of this "situation" leads into misbehaviour of the indicator, missunderstanding of the initialization / deinitialization process etc. (Well I know what initialization and deinitialization is, but in the context to time frame switches and Metatrader this was unclear).
It was not known to me, that by switching the time frame, that a whole "new" initialization process is being started. I assumed that the indicator is valid "per chart". E.g. If I open EURUSD (as special example) that the indicator is valid for this chart over all time frames. I assumed that once the indicator is loaded that it get's initialized, loops through the main process and during removal being deinitialized. So from what I learn now ist this: EURUSD -> H1 -> OnInit(H1); -> OnCalculate(H1); -> (switching to H4) -> OnDeinit(H1); -> OnInit(H4); -> OnCalculate(H4); -> (switching to any other time frame) -> OnDeinit(H4); ... and so on ... This certainly is the MT4 programmed behaviour but not the - for me - expected behaviour.
Of course I understand that by using a different time frame that the "moving average indicator" will take e.g. H1 values for the H1 chart and H4 values for the H4 chart. But then this is why one uses 0 as 2nd parameter of the iMA function, so when the time frame is switched that it receives the correct values.
I wonder what happens if you switch TABS (charts bar). Running the chart window in full screen and then switching from one currency pair to another one takes another huge amount of CPU load AND time for the switch itself. It's unknown what Metatrader does interally. Refresh ? Re-Inizialize ? etc.
For my "performance" issues I might think about an alternative approach to come over these bottlenecks. Solutions would be:
... hrmmm not my day today ...
1. Regarding OnInit(), you can have a boolean flag so that initialization will not take place each time you change a timeframe or similar. For example, when you load your program, flag can start with 0 (zero) and after initialization finishes, you turn it to 1. At that point, each successive OnInit() call will be directed to another part of OnInit(), presumably simpler than the initial one.
2. Regarding optimizations, OnCalculate() will normally run on every tick; my question is, do you really need to calculate in every single tick? I believe the answer is "usually I do not". So you can either use OnTimer() for your work, or put a Sleep() inside OnCalculate(). That way, your program can become orders of magnitude more efficient and without sacrificing a big part of your powers :) Normally, indicators would not need much time to calculate on today's computers, so even half a second should be much more than enough for most of them. In any case, you are possibly having the option to purchase a faster computer - unless of course you do have that one already :)
Yes I am aware of the "locking" system (Singleton). This will work perfectly at 1st time initialization. But my use case is this:
OnInit(); -> Create 35 Labels in a for loop.
OnDeinit(); -> Delete 35 Labels in a for loop (Or deletall).
Right now in my mind is this. If I use the Singleton to prevent Objects from being re-created within the OnInit(); function when I switch time-frame. But switching the time-frame will call the OnDeinit(); function. What I can do is, check for the Singleton there as well and prevent the objects from being deleted (or have the entire deleting mechanism removed). But this leads that the objects are being stored in the *.chr files in the profiles directory once I exit metatrader. Storing the information there is what I don't want. I can use the Singleton, which clearly saves a shitload of time when switching time-frames (since it doesn't need to remove and recreate the objects over and over again). But I need to think of a way - I haven't looked at it right now - to receive a signal for metatrader termination, so OnDeinit(); receives the flag and deletes the objects. I am still making up my mind to seek a different approach.
Yes the data visualization doesn't need to happen within Ticks. Some stuff is being laid out into OnTimer(); (clock, news) some in OnCalculate(); (atr, ema calculations etc). This luckely isn't the problem. The problem was that I wasn't aware of the context switching (e.g. new Init and Deinit) once you switch time-frames. I thought that init/deinit happens only once for the entire chart.
I have written a small context tester that proves this (attachment). Nothing special but ok for the needs.
Coming back to the point of "do I need the information all the time (tick)". The question should be rephrased to "do I need that information on all charts (running in the background to some degree)". Therefore it might be an exercise to outsource the entire indicator into a separate application by creating an RPC including socket communication. So whenever I switch time-frame data only is being sent. No need to deal with objects and other stuff. No need to use windows api to load external resources etc. This will make "my special requirements" less dependant to metatrader at the end (in case the entire MT4 API is being trashed once again or in case I need to switch to another charting software). An external GUI application (which I can program native on Linux using GTK+ for example) that listens to a socket (which will be opened through the *.mq4 file) and then sents all data.
Ok, you may want to look out for _StopFlag. I have not done it my self, but it seems it can be useful ; I suppose you can leave the OnDeinit() free of having to delete the labels and perform your own deinitialization logic inside OnTimer(), OnCalculate() or wherever
edit. I wish to correct my self. You can not propably check for _StopFlag inside OnTimer() or the others, but only inside OnDeinit(). It should be so because when you are closing the program, Metatrader calls OnDeinit; so, by checking for _StopFlag inside there you can understand if OnDeinit was called by a e.g. timeframe change or because of unloading or exiting
Yep, I tried UninitReason as well and it seems to do the trick , unlike StopFlag (which is strange , by the way - i mean , it should work), and in addition it gives some more options
Please find attached a code fragment, that helps you to boost up your indicators. The code example is neither perfect nor do I claim it to be the "best" solution.
As explained above, the use case was as follows. Let's assume you have 10 currency pairs open in metatrader. Each chart window (where a currency pair will be made visible) is running one or more indicators. In my case it's an information provider. This information provider creates say 35 Labels and fills the values with information that I think I need. On exit (metatrader being closed) these 35 Labels should be removed once again because I dislike having them in the *.chr files.
The indicator does various "time consuming" tasks and with 10 currency pairs open, all these tasks run simultaneously. No matter whether you pay attention to all chart windows at a time or not. In most cases you focus your attention to one or two chart windows at a time. Both chart windows might show similar information. But in the background all indicators are operating and updating their visible data. This of course drains CPU performance.
Another issue is, that while we all happily switching time frames from H1 to H4 to M1 to M5 to MN1 and so on, the internal mechanism of metatrader happily runs OnInit();, OnDeinit(); creating and trashing all objects that we previously build up. Now imagine that your OnInit(); might also initially load up files, pulls information from a webpage and so on. Now each time you switch the time frame all this stuff happens over and over again. This of course drains CPU performance once again.
Another issue is, in case you have your charts running in full screen is the question whether updating the other indicators (in the hidden window) is necessary ? Sure, if you have an indicator that needs to "alert" you a state, then this is of course a must. But if you have an indicator that shows you the time and some news, then this is not really necessary. Running tasks in hidden windows of course drains CPU performance.
A possible solution would be to install a Singleton, that only creates the objects on program launch and removes the objects on program termination (but not during change of time frames). Another solution (basicly an add on) would be to offer the possibility to update the indicator contents - only - if the window has the focus.
The Boost.mq4 skeleton could come handy here. I hacked this together because I need to solve a quick scene, to get my things going on, until I figure out a different approach or way of handling all this. I will now adopt this to two of my own indicators and see how things progress.
Update 1: Code slightly modified.
Update 2: While the previous update required an explicit window focus to do some tasks, this version checks if the window is the top most window in the Z axis. So the top ancestor window will be updated all the time. This makes sense, in case you switch to another program (e.g. browser, mailer, editor etc.) while still being able to keep an eye on the charts and still have it updating.