Hi MrLong & all,
Time to post my optimized version of 1.08. Goals of my modifications: lower cpu usage by eliminating redundant calculations and simplifying mainenance of the grid by an alternate method of drawing the cells and placing the columns within the cells.
Multi_10_4_EAv1.08rsi_stoch_JM.mq4
modifications here:
- split func DisplayGrid() in two for runtime optimization: CreateGrid() and UpdateGrid()
- replaced redundant function calls in CreateGrid() and UpdateGrid() to further optimize cpu usage
- declared extern int GridMethod to switch between original code and simplex code (temporarily)
- simplified positioning of columns in grid by arrays
- simplified drawing of grid background: drawRectangle()
- functions LabelCreate() and LabelSetText() to simplify object management
- On my display grid columns of open trades and corr. pairs were intermingled. Fixed this.
- patched functions CloseAllButtonBeenHit() and DeletePendinglButtonBeenHit() for a flexible positioning of close buttons
- changed some color settings, just a matter of personal preferences without public value
List of new functions:
- drawGridBack: draw the grid
- drawRectangle: draw a rectangle consisting of labels
- LabelCreate: name says it all ...
- LabelSetText: name says it all ...
- CreateGrid: replace DisplayGrid in init()
- UpdateGrid: replace DisplayGrid in start()
List of modified functions / code sections:
- global declaration section: new var GridMethod
- global declaration section: several new declarations - look for the comments
- init(): changed some colors and coordinates to my personal needs. Called CreateGrid instead of DisplayGrid.
- start(): Called UpdateGrid instead of DisplayGrid.
- CloseAllButtonBeenHit(): replaced hardcoded coordinates
- DeletePendinglButtonBeenHit: replaced hardcoded coordinates
NO changes were applied to trading decisions, etc. - just cpu optimization and gui stuff.
Some remarks:
When reviewing my modifications browse for the string
simplex - I marked any change / new function I placed in the code (hope so, at least

).
By switching
variable GridMethod to values 0, 1 or something else you can switch between MrLong's original version and mine. This is thought to be a temporary measure to help MrLong integrating my stuff.
Settings: 0: simplex runtime optimized and simplex GUI / 1: simplex runtime optimized, MrLong GUI / else: MrLong original
function
drawRectangle: replacement for drawCell(). I created this because drawCell sometimes changes horizontal and vertical positioning coordinates when changing height / width settings. Extremely hard when it comes to code maintenance.
bool useWebDings: function drawRectangle has two different methods of drawing a cell implemented. The default method is called when useWebDings == true and works based on the TrueType font
Webdings. If you don't have this, set useWebDings == false. Then the alternative method base on WingDings will be called. Rectangle heights and widths of both methods are not compatible! You cannot set width / height on pixel granularity, but on character granularity. Will not fit every possible use, but should be sufficient for creating text oriented grids.
Arrays gridCol1, gridCol2, footCol1, footCol2: supply one single point in the code for changing horizontal column coordinates. No inline patches necessary.
I set
grid size to fit the 1366 pixel wide display on my elderly test machine. These are subject to your personal changes.
I set
columns positions to allow for long strings under
correlated pairs.
@all: this version is meant primarily for MrLong to integrate in his v 1.09. That's why there are several if statements to switch between his version and mine. And I set my preferred colors in init() because I did not want to mess up his code too much. So if you don't want to bother about this just stand by until MrLong uploads his next version.
@MrLong: any question that might appear during integration is welcome!
That's it! Have fun testing & integrating!
Cheers, Jürgen
EDIT 2013-03-26 16:50 CET: upload a new version that fixes 3 issues. Delete old version.
You do not have the required permissions to view the files attached to this post.
If you can't explain it simply, you don't understand it well enough. (Albert Einstein)
It appears that the Weighted Moving Average was invented by a trader who did not have a firm grasp of filter theory in hopes of reducing lag. (John F. Ehlers)