Tuesday, November 1, 2016

Grab all stock identifiers

Takes a string, extracts the symbols having alpha chars only.   Grab them, sort the list, count common symbols, all sort of stuff.  But just generate arbitrary symbols to tag with bids. and Test a  pit boss that sort by  probability of stock identifier.


class Data:
  def __init__(self, text):
   self.val = text
   self.prob = 0.0
  def __repr__(self):
   return repr((self.val, self.prob))

def just_symbols(text) :
 end = 0
 size=len(text) 
 while True :   
  start = end
  print(end,start,text[start]) 
  while not text[start].isalpha() :
   start+=1
   if start == size-1 : break 
  end = start
  while text[end].isalpha() :
   end +=1
   if end == size-1 : break
  if end <= start : break
  mylist.append(Data(text[start:end-1]))

How do I run a test?  Well, just casually messing with the nest block code, I an see yhis:

import tradingpit as Pit
G = Pit.Garray(init)
sets = node() # make an anchor node just below the top (+=1 in the array).
for obj in mylist
 node().itext = obj.text

OK, that is is, my semi radom set of words end up as singletons, at the bottom of the pit.  I can sort them, then I have them grouped, I can identify them and have the groups prepended to the node sets'.  I am two jumps down from handles for  an ordered set of bid/ask according to stock identifier.    But once on the grah, my pit boss is restricted to descents o  the graph, like any other bot.  Buts it graph operator can easily step through the singletons, find start and end of a group, create its anchor, and prepend the singletons.  The anchored groups just are a subdivision of the second node, sets.  All the block  counts maintained with a simple drop through, skipping through an updating counts.  But that process is greatly reduced because as the operators build structure, and trhe maximum number of steps to any bid/ask is equal to your bit precision, at fixed point.  Your traversals are optimally bounded.  Talk to the math folks, they get this.


What kind of trader bots will visit his site?
The common trade is, bid this price, for this stock, find mybuyer three layers deep, and take a prie within ten percent. It will be commonly known are a IIDStock tree works.  The hedge folks will have sophisticated bots, trying to beat the traders and pit boss on bit error.  But these hedge bots pay a price for excess time on the graph, and suffer n uncertainty regarding timeout.  It is, ultimately a fair game.  And, even if I sit here and casually try out chunks of code, I am gonna get real close and have trading pit just as smart card dominates, I will be richer than Bill Gates.

A note on trader bots

They can spawn and dump children onto the top of the tree, with plots to meet them on the way down.  All acceptable, all verifiable, the pit boss does it all he time.  But, subject to cycle and time out risk.

A note on code verification

My pit boss will use in place sort. A legal move, for ythe pit boss. And, it is entirely possible to grant space on the tree so the traders can do sort.  These key function calls, embedded in python will all be characterized and verified.  That is, regardless of how the sort is done,the precision of the sort mostly goes with cycles on the graph  the red/green is maintained, and it is a bounded descent; hence verifiable.

let's look at sort from the hackers point of view.  The python person claims the precision of sort rises as cycle count.  It ets deployed.  Then some Russian hacker, sitting around all winter, starts tesying sort, and finds a ga]p when one does a compound sort by two then three elements.  That means the trader can deploy a trader bots that hunt down two groups of three, in the bid pol, where the cycle cost is cheap for sort;  it only sort on these, it gets a precision jump.  .  Then the pit boss is stuck with the bots,constantly pooling up, waiting for some spot.  The tree gets noise, gets jammed.,

No comments: