What we've done,
- types: refactor Position and related files
- types: add PositionMap in std Stream & callbacks
- binance: support submit futures order
- binance: remove comments not support isolated futures
- types.Account
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| "math/rand" | |
| "reflect" | |
| "time" | |
| ) |
| --- | |
| persistence: | |
| redis: | |
| host: 127.0.0.1 | |
| port: 6379 | |
| db: 0 | |
| sessions: | |
| binance: | |
| exchange: binance |
| // a tiny functional event emitter / pubsub. | |
| fn Emitter(){ | |
| all := {'*':{}} | |
| return { | |
| // A Dynamic object/Map of event names to registered handler functions. | |
| 'all':all, | |
| // Register an event handler for the given type. | |
| 'on':fn(type, handler){ | |
| (all[type])?push(all[type], handler):set(all, type, handler) |
| ; source file: prog/hello.s1 | |
| ; External declaration of the puts function | |
| declare void @puts(i8* nocapture) nounwind | |
| ; Declare the string constant as a global constant. | |
| @name = internal constant [8 x i8] c"script1\00" | |
| ; Definition of main function | |
| define void @main(i32 %argc, i8** %argv) { | |
| ; Convert [13 x i8]* to i8 *... in local |
| func (s Harmonic) SharkLong(highs, lows *types.Queue, p float64) float64 { | |
| score := 0. | |
| for x := 5; x < 300; x++ { | |
| X := lows.Index(x) | |
| for a := 4; a < x; a++ { | |
| if highs.Index(a-1) < highs.Index(a) && highs.Index(a) > highs.Index(a+1) { | |
| A := highs.Index(a) | |
| XA := math.Abs(X - A) | |
| hB := A - 0.382*XA | |
| lB := A - 0.618*XA |
| func ReactivePredictor(memoryLength int, moves, wins types.Queue) float64 { | |
| stateMachine := make(floats.Slice, int(math.Pow(2, 2.*float64(memoryLength)-1.))) | |
| indMap := make(floats.Slice, 0) | |
| for i := 2 * memoryLength; i >= 0; i-- { | |
| indMap = append(indMap, math.Pow(2, float64(i))) | |
| } | |
| partOfMoves := moves.Array(moves.Length()-memoryLength, moves.Length()-1) | |
| partOfWins := wins.Array(wins.Length()-memoryLength-1, wins.Length()-1) | |
| lastState := append(partOfWins, partOfMoves...) | |
| lastStateInd := 0. |
unzip m64.zip -d $HOME/qmv kc.lic $HOME/q/
├── kc.lic
├── m64
│ └── q
└── q.k
| # requirements: pip install python-binance | |
| # rest API | |
| from time import time, sleep | |
| from binance.client import Client | |
| loop=10 | |
| KEY = 'your_key_here' | |
| KEYSEC = 'your_secret_here' | |
| total_delai = 0 | |
| bclient = Client(api_key=KEY,api_secret=KEYSEC) | |
| for i in range(loop): |