Skip to main content


MQL5 indicator artifacts issue

MQL5 indicator buffer random valuesDuring my coding of an indicator random values would end up in the index buffer if one would switch time frames. It took me a few hours to figure out that if I didn't explicitly set an empty value this would cause this to happen - so the solution is to always set a value during your OnCalculate() loop both for your empty bars and not. /* OnCalculate =========== Called only in custom indicators when it's necessary to calculate the indicator values by the Calculate event. */ int OnCalculate(const int iRatesTotal, const int iPreviousCalculated ,const datetime &time[] ,const double &aOpen[] ,const double &aHigh[] ,const double &aLow[] ,const double &aClose[] ,const long &tick_volume[] ,const long &volume[] ,const int &spread[]) { Print(">>> OnCalculate(): `iRatesTotal=" + iRatesTotal + "`, `iPreviousCalculated=" + iPreviousCalculated + "`"); //int iStart…
Recent posts

A review of my one month FOREX trading experience

In Charts and TablesMy first month trading FOREX trading is now complete and as expected (but definitely not wanted) my account balance has gone down 52%. I have done a total 115 trades which equates to about 28 trades per week.Trade History export to CSV MetaTrader must have been designed by geeks for geeks as there is no export to CSV/Excell. Fortunately I am such aforementioned geek and created a script for this purpose. On the bright side is I expected to start learning MQL at some point so this started that process. You can find my script at this link: MetaTrader Export Trade History to CSV.Lossing vs Winning Trades I did really great in the first week, perhaps it was luck perhaps it was new trader confidence. Looking back at the trades I seldom had a stop loss, had a generous stop loss in place, or kept adjusting it, and I recall leaving the trades alone then coming back to them seeing profits and just setting a trailing stop loss; I can possibly confirm this by looking how the or…

Least Correlated Forex Currency Pairs

Minimizing risk trough Un-correlationThe number of possible major/minor currency is large and trading currencies that are correlated logically increases risk. My Google search for least correlated Forex pairs came up empty so I decided to run the analysis myself. Using information from this list on Oanda I created a JS script that would loop through the table entires and return the least correlated pairs based on the 1 year value. To my surprise I had to permit high correlations of >0.80 for the major currencies, and >0.95 for the major and minor currencies together to get values returned.Major Currencies ["AUD/USD", "EUR/AUD", "EUR/CHF", "EUR/GBP", "EUR/USD", "NZD/USD"] Major + Minor Currencies ["AUD/CAD", "AUD/CHF", "AUD/HKD", "AUD/JPY", "AUD/NZD", "AUD/SGD", "CAD/CHF", "CAD/HKD", "CAD/JPY", "CAD/SGD", "CHF/HKD&quo…

`` Debian init script

Startup init script for the Distributed WPA PSK strength auditor python scriptTurning the `` utility into a system daemon can be achieved by utilizing the `screen` utility, below is my first attempt at it - feel free to comment with improvements or questions. #!/bin/sh ### BEGIN INIT INFO # Provides: # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO # Symbolic link this file into your `/etc/init.d`, then run `rcconf` and select the script to start, note the file name must be alphanumeric only # example: `root@sh1:/etc/init.d# ln -s /usr/local/ help_crack` dir="/usr/local/" cmd="screen -d -m -S ./" user="" #!/bin/sh ### BEGIN …

Lightning Out off Platform Example

Due to the limited documentation out there for the BETA Lightning Out functionality I am posting my code for others to benefit.Please note that after extensive research I have come to the conclusion that off platform functionality is broken, but executing the code from within a naked VF page should work. The issue is that the bootstrapping process does not adjust the URLs for the dynamically loaded scripts and styles sheets - the JS assumes it is still run from within a SF org domain. A case with SF has been filled but if I am incorrect on my conclusion please comment. Even if one patches the script/style URLs loading at runtime further errors manifest from withing aura_prod.js Salesforce's 'Lighting Out' ExamplePrior to using the below code ensure you have wrapped your lighting component into an App, setup a connected App, and CORS whitelisted your domain - afterwards copy and paste the below into your HTML file to be served from a server. ... <div id='lightning…

Windows Error: "Source Path Too Long"

Unable to delete folder due to 'path too long' error Windows dinosaur 256(?) path limitation weirdness prevented me from deleting a backup recovery folder, the solution to that is to use a utility called Unlocker - it also allows deletion/moving of locked files. If you found this useful feel free to follow me on twitter @danielsokolows or comment, also do donate the author of the program.

Softeher 'Error occurred. (Error code: 2)' sollution

Protocol error occurred. Error was returned from the destination server.The Softether server by default to run on port 443, if you server also hosts normal https then 443 is already taken and so Softether can't bind to it. When you run `vpncmd` it attempts to connect, find an active port, but of course fails with 'Protocol error occurred. Error was returned from the destination server.' because it's not actually connecting to the vpn server. By default Softether also listens on 992, 1194, and 5555 so the sollution is to modify specify `localhost:5555` when executing the `vpncmnd`. If this has helped you feel free to comment or follow me on twitter @danielsokolows.