Skip to content

Instantly share code, notes, and snippets.

View alun's full-sized avatar

Alex Lunacharskii alun

View GitHub Profile
@alun
alun / changelog.md
Last active September 8, 2022 10:49
Stoken ACA - Zorro

v2

  • added full portfolio rebalance (33% each slice):
    • when one of the slices (algos) switches the risk on/off mode
    • one a year
  • added plotting of the fractions of each slice in portfolio
  • some minor refactoring

v1

@alun
alun / history.c
Last active August 28, 2022 19:42
Zorro adjusted vs unadjusted history
function main() {
int data_feed = FROM_YAHOO ;
// int data_feed = FROM_STOOQ ;
data_feed |= OVERRIDE ;
assetHistory("SPY",data_feed);
History = "*una.t6";
assetHistory("SPY",data_feed|UNADJUSTED);
@alun
alun / GenT6History.java
Last active August 27, 2022 18:45
Dukascopy JForex strategy to export prices history to Zorro trader
package jforex;
import com.dukascopy.api.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import random
total=1000000
in_circle=0
for i in range(total):
(x,y)= (random.random(), random.random())
if x**2 + y**2 <= 1:
in_circle+=1
4*(in_circle/total)
@alun
alun / mangan.ipynb
Last active December 29, 2021 20:44
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alun
alun / README.md
Last active July 3, 2020 20:14
Get Kubenetes pods' docker images

Ever wanted a quick shell cmd to get docker images running in your Kuberentes pods?

Here is one using JQ

Examples

$ kgimg
[
 {
import javafx.util.Pair;
import org.testng.annotations.Test;
import java.util.*;
import static org.testng.Assert.*;
public class Sol {
static Set<Map<Integer, Integer>> indexPointers(String s) {
Set<Map<Integer, Integer>> result = new HashSet<>();
global
maxconn 4096
#debug
#quiet
defaults
mode http
option httplog
option dontlognull
retries 3