CSM indicator (hanover)

0
(0)

NOTE: Aside from updating some previous posts, I've left Foreign exchange Manufacturing unit, so do not anticipate replies to your posts. You will discover an index to all my indicators .

CSM (forex energy meter histogram indicator)

I made a decision that the CSM indicator was worthy of its personal thread, particularly as put up #1 may be up to date ceaselessly with new variations. All the things was getting scattered and laborious to search out; I've tried to assemble every part up and embody it right here on this one put up. Therefore it is going to be an extended one.

I've made one other small enhancement, the ShowValues setting has been changed by ValuesSpacing, defined within the directions beneath.

Right here is the newest CSM and all the parameter recordsdata ('p-files'). I've included .mq4 supply code however you will want do do that first, in any other case it's going to compile with a zillion errors. To keep away from any issues, obtain the .ex4 file solely.

Connected File

The CSM indicator is not a holy grail, it lags sentiment similar to each different price-derived energy meter

Be aware that while you first load the indicator, it should obtain all the required knowledge (for the timeframes that you have chosen) out of your dealer's server. This would possibly take a number of minutes, particularly when you've requested for a number of pairs/devices, and time frames, to be collated. You may have an app like this obtain this knowledge, when you want.

Disclaimer: As all the time, this software program is supplied freely and will not be offered or distributed commercially. Code is obtainable on an 'as is, take it or go away it' foundation with no assure that it really works as you imagine that it ought to. Obtain and use it at your individual threat; I settle for no legal responsibility for any pc harm or monetary losses.
______________________

Parameter Settings

ParameterFile: that is defined beneath (see the Parameter Recordsdata part beneath) .

CurrencyPairs: Enter the values of the pairs that you really want the indicator to think about, separated by commas. Permissible abbreviations are: A=AUD; C=CAD; E=EUR; F=CHF; G=GBP; J=JPY; N=NZD; U=USD; H=HKD; S=SGD; Z=ZAR. So you might kind GU or gu as an alternative of GBPUSD, for instance. Be aware that these are the pairs that can be used within the calculations to achieve a relative energy/weak point worth for AUD, CAD, CHF, EUR, GBP, JPY, NZD and USD. Exotics, metals, cryptos and so forth which are supplied by your dealer may be included within the energy/weak point calculations for these 8 main currencies, however histograms are plotted for the 8 majors solely.

CurrencySuffix: To additional save repetitive typing, CurrencySuffix will get appended to the top of each entered pair. Therefore in case your dealer is providing pairs named EURUSD.professional, GBPJPY.professional, and so forth, you might enter CurrencyPairs as eu, gj, and so forth, and CurrencySuffix as .professional

TimeFrames: the timeframes for which you need histograms to be displayed. Legitimate values are M1, M5, H1, D1, MN, and so forth. The histograms will plot, from left to proper throughout your display, within the order that you just specify right here.

NumberOfCandles:
ApplySmoothing:
TriangularWeighting:
These are defined within the 'Calculation' part beneath.

HistoricalShift: Exhibits what the histograms would have seemed like X candles in the past (in every timeframe). That is actually solely significant for one timeframe to be thought of. For instance, getting into -5 would present what the histogram seemed like 5 hours in the past on the H1 TF, however 20 hours in the past (5 x 4 hours) on the H4 TF. Enter 0 to see the present histograms on all TFs.

SortMethod: Enter D to have the histograms in every timeframe plot in descending order of worth (strongest forex on the left, weakest on the best). Enter A to have the histograms in every timeframe plot in ascending order of worth (weakest forex on the left, strongest on the best). Go away the setting clean and the currencies can be displayed in alphabetical order.

ValuesSpacing: typing a worth > 15 strikes the displayed values additional away from the highest of the histogram bar; a worth < 15 strikes it nearer. A price of 0 stops the values from being displayed in any respect.

FontName: used for plotting the histograms, this must be both CSM or Placard MT Condensed, which can be found within the Fonts folder within the zip file. For assist with putting in fonts, see this. The histogram is definitely the letter I repeated many instances, after having been rotated onto its aspect. You may strive utilizing different fonts, nut these two are the very best that I've discovered. The screenshot beneath reveals the distinction within the histograms utilizing the 'CSM' font (above) and the 'PLCC__' (Placard) font (beneath).

Connected Picture (click on to enlarge)
Click to Enlarge

Name: PPI 634.png
Size: 25 KB

FontSize: the scale of the font that can be used for plotting the histograms. If you happen to regulate this, you'll most likely must additionally regulate the HorizSpacing to take care of an acceptable distance between the histogram bars.

SeparateWindow: if TRUE, the histograms will plot in their very own window; if FALSE, the histograms will plot in the principle chart window.

HorizPos/VertPos: the histograms plot in a hard and fast display place, i.e. they do not transfer with the candles. The HorizPos/VertPos settings characterize the place to begin, in pixels, for the primary histogram TimeFrame to be plotted.

HorizSpacing: the spacing, in pixels, between every histogram bar.

Colors_AUD via Colors_USD: the present model of CSM plots histograms for these 8 currencies solely. Now you can have totally different colours for various ranges of values for every histogram bar. For instance, in order for you the USD bar to show as White solely when the energy worth > 80 or <= 20, and DimGray in any other case, you'll kind into USD_colors: 100,White,80,DimGray,20,White,-1
In different phrases, values and legitimate coloration names have to be typed alternately, separated by commas, with the values in descending order, ranging from 100 and ending with -1. For the reason that coloration 'White' seems between 100 and 80, the histogram will plot as White for USD, if the histogram worth is between 80 and 100, and so forth. You may specify as much as 20 colours (41 entries). Colours could also be entered as (i) legitimate MT4 tokens (Orange,DarkGoldenrod, DeepSkyBlue, and so forth); or (ii) RGB entries like r60g45b117 with every worth between 0 and 255, and the R, G and B values in any order (if omitted, the Purple/Inexperienced/Blue part is assumed to be zero); or (iii) because the hexadecimal illustration (00 via ff) 0xaabbcc, the place aa is the Blue part, bb Inexperienced and cc Purple; or (iv) a decimal quantity that is the same as (Blue x 255 x 255) + (Inexperienced x 255) + Purple. See the chart right here for more information. And/or obtain a free, helpful coloration selector software like this one.

Textual content Font/Dimension/Shade: these decide the font/dimension/coloration of the textual content printed beneath the histograms.

RefreshPeriod: determines how usually the histogram values are recalculated and replotted. Entries are defined intimately right here.

UniqueID: you'll want to specify a special UniqueID for every occasion of CSM on the identical chart.

OutputFilename: to disable this facility, go away the setting clean. In any other case output can be despatched to a file of the title you specify within the ..../MQL4/Recordsdata folder. The file will get overwritten with contemporary knowledge each RefreshPeriod. You may specify a subfolder (beneath the Recordsdata folder) by getting into one thing like subfolderfilename. You may embed the chart image or the date/time within the file title by together with [sym] or [dt], respectively, within the filename. The output file might be learn by an EA, in order that forex energy values can be utilized to contribute to the EA's resolution making course of. The format of the output file is fastened, and appears like this:

Inserted Code
TF , AUD, CAD, CHF, EUR, GBP, JPY, NZD, USD
M1 ,  36,  71,  30,  47,  15,  70,  67,  64
M5 ,  49,  56,  25,  64,  44,  49,  55,  59
M15,  51,  57,  33,  60,  54,  33,  54,  57
M30,  52,  67,  36,  52,  60,  37,  47,  48
H1 ,  60,  70,  30,  47,  64,  34,  47,  48
H4 ,  75,  71,  21,  31,  64,  39,  58,  39
D1 ,  80,  81,  21,  42,  58,  28,  56,  35
W1 ,  66,  86,  37,  61,  47,  14,  65,  24
MN ,  63,  76,  45,  65,  38,  19,  68,  26

OutputGlobals: if set to TRUE, CSM can even output all present histogram values to International variables, to be used in an EA (as a substitute for outputting the values to a file). The title of every world can be CSM-[UniqueID]-[timeframe]-[currencyID], e.g. CSM-1-M15-USD. These are up to date as soon as each RefreshPeriod. If FALSE, International variables are usually not used.

HighlightBox: if TRUE, the H4/D1/W1 timeframe names are underlined (these are the timeframes that I have a tendency to review). If FALSE, they aren't underlined.

DisplaySpread: One other new characteristic is the little numbers that appear to be <-n-> which characterize the 'unfold' between the best and lowest forex values (could also be +/-1 because of a rounding error). A variety of 60 or larger usually represents respectable momentum when you pair the outermost currencies, on that timeframe. A price lower than 40 tends to imply that the market as an entire is flat/rangebound. Set DisplaySpread to TRUE to allow this facility, FALSE to disable it.

SummarySpacing/SummaryLevels: These settings allow/disable the 'Development Abstract' graph. Be aware that this graph will not be plotted at a hard and fast display location just like the histograms; it strikes with the candles. SummarySpacing determines the width between every timeframe plotted alongside the horizontal axis. Setting it to 0 disables the graph altogether. SummaryLevels decide the degrees for which horizontal strains can be plotted. Enter rising values between 0 and 100, separated by commas.

How you can interpret the Development Abstract: it's merely a plot of the histogram values for every forex, from month-to-month right down to M1. If you happen to're seeking to enter in the beginning of renewed momentum following a pullback in a long term transfer, ideally you wish to pair two currencies whose curves are situated/formed one thing like these proven right here:

Connected Picture
CSM indicator (hanover) 1

If you happen to're having issues with the abstract, strive (1) utilizing the arrow keys to scroll it to the best of the chart, (2) utilizing the +/- keys to vary the chart zoom and candle widths, (3) rising or reducing the indicator's SummarySpacing worth, (4) turning MT4's Navigator, Market Watch, and so forth off to achieve extra display house, (5) transferring MT4's chart shift setting (the little triangle on the prime proper of the principle chart) leftward to achieve extra space past the RHE, or (6) altering your monitor's decision settings. Or if it is a nuisance, and also you'd quite see solely the histograms, merely set SummarySpacing to 0.

Calculation --- how the CSM histogram values are calculated

The unique system labored solely on the D1 TF, and the presently forming candle. It checked the place worth presently was, by way of the candle excessive and low, expressed as a share. For instance, if worth was presently on the excessive, the worth returned was 100%; on the low, 0%; three quarters of the best way up the candle, 75%; and so forth.

Then it transformed this into a worth between 0 and 9, thus:
Above 97%, worth = 9
Between 90% and 97%, worth = 8
Between 75% and 90%, worth = 7
Between 60% and 75%, worth = 6
Between 50% and 60%, worth = 5
Between 40% and 50%, worth = 4
Between 25% and 40%, worth = 3
Between 10% and 25%, worth = 2
Between 3% and 10%, worth = 1
Lower than 3%, worth = 0

It processed all the candles for every forex pair. Let’s say the pair presently being processed is USDCHF, and worth is presently 64% of the best way up the candle. Then it could assign a worth of 6 for USD, and 9 minus 6 = 3 for CHF. Then it could repeat the identical for all forex pairs (as laid out in CurrencyPairs), common the outcomes for every forex (not pair), and plot the values.

CSM extends this idea in no less than 4 alternative ways:

1. You may specify NumberOfCandles. If set to 1, then this is able to work because the Giraia indy did, i.e. function on the presently forming candle. If set to 2, it consists of each the presently forming candle, and likewise the one instantly to the left; and so forth. It makes use of the best and lowest factors throughout the 2 candle interval as 100% and 0%, respectively. Therefore the worth displays the place worth presently is, relative to the best and lowest level of the final n candles, the place n is the NumberOfCandles setting.

2. The above assumes that ApplySmoothing = false. Setting this to true implies that all the course of can be repeated, over the past NumberOfCandles candles, and the end result averaged. For instance, suppose NumberOfCandles is about to 4. Then if ApplySmoothing = true, all the calculation (as defined beforehand) is run for every of NumberOfCandles = 1, 2, 3 and 4, and the 4 outcomes averaged. This successfully implies that, if ApplySmoothing = true, there's a increased weighting utilized to the newest candles. If set to false, it's merely the place worth is, relative to the excessive and low of the final n candles.

3. As an alternative of being restricted to the D1 TF, separate plots could also be generated relying on the consumer’s alternative of TimeFrames. Every TF is calculated utterly independently of the others.

4. For no matter it is price, I take advantage of NumberOfCandles=25, ApplySmoothing=true, TriangularWeighting=false. Here is how they work:

i) If ApplySmoothing=false, then TriangularWeighting is ignored, and the worth calculated for every pair is solely the rise/fall from candle #25 (if NumberOfCandles=25) to the present worth.

ii) If ApplySmoothing=true, and TriangularWeighting=false, then the rise/fall for every candle from candle #25 to candle #1, from that candle to the present worth, is averaged to offer a 'smoothed' worth over the past 25 candles.

iii) If ApplySmoothing=true, and TriangularWeighting=true, then the rise/fall from candle #25 to present worth is multiplied by 1, the rise/fall from candle #24 to present worth is multiplied by 2, the rise/fall from candle #23 to present worth is multiplied by 3, ........ the rise/fall from candle #1 to present worth is multiplied by 25, earlier than the averaging takes place. This attaches a fair increased weighting to the newest candles.

Parameter Recordsdata

To make altering the colours simpler, you need to use parameter recordsdata ('p-files'), which may be edited with a textual content editor like Home windows' Notepad. For its settings to override the MT4 dialog settings, the file have to be named as follows: in case your entry in ParameterFile is xxx, then a file Presets---CSM.xxx should exist within the …/MQL4/Recordsdata folder that's formatted precisely as described beneath. If the file would not exist, e.g. setting to ParameterFileto NONE (and no file …/MQL4/Recordsdata/Presets---CSM.NONE exists), then the settings that you just kind into MT4's dialog field will apply.

That will help you, I've included some dummy recordsdata within the zip, e.g. Presets---CSM.20, Presets---CSM.25 and Presets---CSM.30
These pattern recordsdata will show all the histogram bars in a dim grey coloration at any time when the values are between 20/80, 25/75 or 30/70 respectively. So as an alternative of getting to retype all the coloration settings, you might merely swap ParameterFile to 20, 25 or 30. I've additionally included a file Presets---CSM.1 named which causes the indicator to behave because it did beforehand. Or you'll be able to merely go away ParameterFile as NONE. I'd recommend that, with a view to be sure that you get your syntax precisely appropriate, you copy these recordsdata after which use them as a place to begin to your entry values.

Parameter file format
The syntax within the p-file MUST comply with the next guidelines and format:
parametername = worth;
Parameter title have to be spelled appropriately (though it could be higher/lowercase, and embody areas or underscore characters (_) to enhance readability), alphanumeric values have to be enclosed in double quotes ("), and each line within the file MUST finish with a semi-colon; failure to take action will trigger unpredictable outcomes.
The file could embody 'remark' strains which can be ignored by the indicator. A remark line all the time begins with two slashes (//) and should then comprise any textual content you would like. Once more, it should finish with a semi-colon. Remark strains can permit you to rapidly swap a parameter from one worth to a different, e.g.
// parametername = value1;
parametername = value2;
which may be simply switched to
parametername = value1;
// parametername = value2;
One other use for feedback is you could 'remark out' a line, to permit you to change that individual setting utilizing the MT4 dialog field, whereas the opposite parameters proceed to acquire their values from the p-file. Then you'll be able to later simply restore the road within the p-file later if you'll want to. (Whereas restoration will not be really easy when you delete the road altogether).

Be aware that after you've got saved any modifications to a p-file in Notepad, it's essential to refresh the indicator for it to learn within the modifications from the p-file. The best approach to refresh all the indicators in your chart is to change to a special timeframe, after which swap again once more.
______________

This can be a one off put up, though I can be including to it, at any time when I make updates to the indicator. Nevertheless, I wont be answering any questions; learn the directions above, and experiment with the indicator your self. The supply code is there if you wish to make modifications (e.g. add your individual alerts, or rewrite it for MT5, .....).

Goodbye as soon as once more, LOL, and good luck everyone. CSM indicator (hanover) 2

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?



Author: Forex Wiki Team
We are a team of highly experienced Forex Traders [2000-2023] who are dedicated to living life on our own terms. Our primary objective is to attain financial independence and freedom, and we have pursued self-education and gained extensive experience in the Forex market as our means to achieve a self-sustainable lifestyle.