*Step 1: Position closing algorithm.*

On new ticker value x of currency $coin do:
  p = get our open position for $coin
  if p exists:
    // relativeValue is the position's PnL in percent under leverage 1
    p.relativeValue = (x/p.openingPriceWithFees-1)*p.direction*100
    p.maxRelativeValue = max(p.maxRelativeValue, p.relativeValue)
    pullbackThreshold = p.maxRelativeValue-pullback(p)

    // LOSS (accept loss to circumvent risk escalation)
    if p.relativeValue < -lossLimit:
      close p

    // SPONTANEOUS HAPPY CLOSE (position is positive & user-definable criterion 
is fulfilled)
    if p.relativeValue > minReasonableProfit and shouldHappyClose(p):
      close p

    // PULLBACK CLOSE (when current value falls significantly below the 
all-time high)
    if pullbackThreshold > 0 and p.relativeValue < pullbackThreshold:
      close p

We have *3 configuration options*:
 * *lossLimit *- maximum accepted loss before leverage
 * *pullback*(p) - maximum accepted relative pullback before closing a positive 
position
 * *shouldHappyClose*(p) - a user-supplied function that can randomly return 
true for a position (that is in the plus!) to have it closed immediately. There 
can be different reasons to do this.

*Step 2: Position opening algorithm.*

Now, the interesting thing is how to define the position opener.

After all, closing a position is basically just milking the pig. You want to 
get as much out as you can, but it's not that complicated of a task.

Opening a position, however,  is like finding the pig among hundreds of animals 
that look like pigs but don't actually give milk.

*Anyone still following? :D*

Anyway, my suggestion for the position opener - the magic piece that gives us 
the short and long signals! - is to simply open a position in the mind every 
time something happens to the ticker price. We also close these positions 
(mentally) when the above algorithm says so.

And when any one of these positions becomes suitably positive, we basically 
assume the trend will continue and actually open a position of a very similar 
kind in real life.

That might not be all there is to it though, I have a feeling the actual 
solution is a little more complicated still.

*Step 3: Optimize the parameters*

Remember, in the beginning we defined 3 parameters (2 of which are even 
functions). We should clearly just try different values for these and see how 
much profit we get in the simulation. This should be done for each crypto 
currency.

A clear plan, right? Let's go then!!
------------------------------------------
Artificial General Intelligence List: AGI
Permalink: 
https://agi.topicbox.com/groups/agi/Ta2a8c93c499a68be-M5dae5cd93622425911c048f4
Delivery options: https://agi.topicbox.com/groups/agi/subscription

Reply via email to