Skip to content

Instantly share code, notes, and snippets.

View dennislwm's full-sized avatar

Dennis Lee dennislwm

View GitHub Profile
@dennislwm
dennislwm / Jurka_03_spam_RTextTools.R
Created February 28, 2013 13:34
Classifying Emails as Spam or Ham using RTextTools
suppressPackageStartupMessages(require(RTextTools))
suppressPackageStartupMessages(require(tm))
source("C:/Users/denbrige/100 FxOption/103 FxOptionVerBack/080 Fx Git/R-source/PlusReg.R", echo=FALSE)
spam.dir <- paste0(RegGetRNonSourceDir(), "spamassassin/")
get.msg <- function(path.dir)
{
con <- file(path.dir, open="rt", encoding="latin1")
text <- readLines(con)
msg <- text[seq(which(text=="")[1]+1,length(text),1)]
close(con)
@dennislwm
dennislwm / 0_reuse_code.js
Created June 11, 2016 04:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dennislwm
dennislwm / Ghost Paper Trading in Metatrader 4 (MT4).md
Last active April 7, 2022 08:29
FX-Git Packages in Metatrader 4 (MT4)

How NOT to Quickly Turn a Profitable Strategy into a Loss-Making One

Introduction

Did I get your attention?

One of the limitations of using a demo broker account is that there is no or very little slippage, hence it does not reflect actual trades.

The result is that a "profitable" robot or Expert Advisor ["EA"] on a demo account can quickly become a loss-making robot in a live account.

@dennislwm
dennislwm / ledger-analytics_specs.md
Last active October 23, 2019 11:00
Specs for Ledger CLI

Ledger-Analytics Backend API Specifications

Create the backend for Ledger CLI. The frontend/UI uses React / .


Routes

Get the source code for the routes file.

@dennislwm
dennislwm / Master-Slave.md
Last active January 27, 2020 05:23
MT4-Telegram-Bot-Recon

Prerequisite

  • MT4 Demo Account

Challenge

Create a function that returns a chain of history and partial orders from a single ticket number

@dennislwm
dennislwm / Cumulant Ratio Indicator in Metatrader 4 (MT4).md
Last active April 2, 2021 21:05
FX-Git Indicators in Metatrader 4 (MT4)

A Non-Lag Indicator using Digital Signal Processing in Metatrader 4 ["MT4"]

Introduction

What the heck is Digital Signal Processing ["DSP"]?

For those not familiar with DSP, it is an engineering tool used to filter noise from signal and it has many practical uses in different industries.

In 2011, when I started trading in the forex market, I purchased several books including a trading book, titled Cybernetic Analysis for Stocks and Futures by John F. Ehlers. This was my first encounter of DSP in trading.

@dennislwm
dennislwm / 1. Suggested template
Last active December 14, 2019 08:28
Specs for Github Commits
Template:
Summarize the change in less than 50 characters
Because:
- Explain the reasons you made this change
- Make a new bullet for each reason
- Each line should be under 72 characters
Explain exactly what was done in this commit with more depth than the
@dennislwm
dennislwm / Why upgrade to Happi Cookie?
Last active September 9, 2020 02:49
Happi Cookie
#!/usr/bin/env python
import math
import sys
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb)
# Assumes x1 < x2, y1 < y2
@dennislwm
dennislwm / bracket.py
Last active January 22, 2022 07:41
singtel interview coding test find saddle point matrix.py
import sys
for line in sys.stdin:
numOpen = 0
numLength = 0
for c in line:
if c == '(':
numOpen += 1
elif c == ')':
numOpen -= 1
if numOpen < 0: