Skip to content

Instantly share code, notes, and snippets.

@distagon
distagon / Maual Button Trading
Created November 13, 2019 17:25 — forked from marketcalls/Maual Button Trading
Manual Button Trading in Amibroker
Title = " ";
_SECTION_BEGIN("MaualTradingInt1V00 ");
EnableRealTimeControl = ParamList("Enable Controls", "No|Yes", 0);
EnableAutoTrade = ParamList("Enable Autotrade", "No|Yes", 0);
ClientIdValue = ParamStr("Client Id", "CLIENTID");
PurchaseType = ParamList("Transaction Type", "MIS|NRML", 0);
OrderType = ParamList("Order Type", "LIMIT|MARKET", 0);
BuyPriceSelection = ParamList("Buy Price", "Bid Price|Ask Price|LTP", 0);
<pre>_SECTION_BEGIN;
// Code Source: wisestocktrader
SetChartOptions(0,chartShowArrows|chartShowDates);
/*Body Colors*/
whiteBody=C>=O;
blackBody=O>C;
/*Body Size*/
@distagon
distagon / SimpleStockSystemTemplate.afl
Created November 13, 2019 17:21
Simple AmiBroker stock market system template. Things to be mindful of when designing your system.
// IMPORTANT! When ready to trade your AB system set the following settings:
// Report > Detailed Log
// Portfolio > Tick "Add artificial future bar"
//
// Set the From-To dates of the Backtest to the current month (eg. 1/Jan/16-1/Feb/16).
// Observe the last row to get your instructions for the next trading day.
// I like placing all variables that can be changed and optimised at the top.
// Then when the time comes to optimise, I create a simple:
// a = Optimize( "a", 1, 1, 10, 1 );
@distagon
distagon / quicksk.py
Created January 6, 2019 16:09
群益證券報價 API 實驗程式
import os
import json
import math
import time
import signal
import asyncio
import threading
import pythoncom
import comtypes.client
@distagon
distagon / Account.cs
Created August 8, 2017 13:37 — forked from syctseng/Account.cs
帳戶監視器_KGI
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Watcher
{
public class Account
@distagon
distagon / 群益API with pythonnet
Created August 8, 2017 13:36 — forked from kwedr/群益API with pythonnet
群益API with pythonnet
# -*- coding: utf-8 -*-
import sys, os, clr, time
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue