adlai / scalpl

volatility harvester prototype
atp://127.0.0.1:8080
57 stars 20 forks source link

No clear instructions #12

Open kyrypto opened 4 years ago

kyrypto commented 4 years ago

I've loaded the bot, and all of the dependencies, with Quicklisp. But there's no clear guide on what to do next. I know I need to set the API keys, and some parameters, but there's no indication on how to do it. Any help? I intend only to experiment by the way, I don't expect this to be a magic money maker.

adlai commented 4 years ago

On a scale ranging from "money to knowledge converter" to "knowledge to money converter", although not quite reaching either extreme, what purpose do you seek in your experimentation? Your answers to this question will guide me in answering yours. You may find that the information provided when closing Issue #6 can help you at almost any purpose along that scale, although I intentionally do not provide much code implementing those suggestions.

kyrypto commented 4 years ago

I'd convert money to knowledge, knowledge is invaluable. I seek to learn how trading bots can help me in my daily trading. I actually did notice issue #6, and I'm to the point where I need to "instantiate the gate class with relevant API credentials, a supplicant that manages that account, and a maker with the parameters for automated offer placement." I'm not sure how to do this, advice?

adlai commented 4 years ago

The english verb "instantiate" corresponds quite closely to the Common Lisp function, make-instance. You might be using an implementatino that provides documentation to the running process, although if you can't find the invokation that reveals this, you can browse and download the documents provided by the kind folks at LispWorks, who are even good enough to link to where you can buy a printed copy of the language standard, should you prefer the official materials!

In your specific invocation of that class, you can provide the API credentials as thriither:

(make-instance 'gate :pubkey #p"publickey"
                     :secret "I can't tell you, because you're not yet drunk")

I'd convert money to knowledge, knowledge is invaluable. I seek to learn how trading bots can help me in my daily trading.

I'll notify you, should I choose to sell information... the hubs have ears!

kyrypto commented 4 years ago

The english verb "instantiate" corresponds quite closely to the Common Lisp function, make-instance. You might be using an implementatino that provides documentation to the running process, although if you can't find the invokation that reveals this, you can browse and download the documents provided by the kind folks at LispWorks, who are even good enough to link to where you can buy a printed copy of the language standard, should you prefer the official materials!

In your specific invocation of that class, you can provide the API credentials as thriither:

  • string arguments directly in the call to make-instance, by enclosing the credentials in double quotes, "thus";
  • locations of files containing saved copies of each datum, by providing pathnames as arguments and not enclosing the saved credentials in quotes;
  • or even, should you wish to avoid saving the private part of the credentials to the file system, provide each argument in the appropriate way:
(make-instance 'gate :pubkey #p"publickey"
                     :secret "I can't tell you, because you're not yet drunk")

I'd convert money to knowledge, knowledge is invaluable. I seek to learn how trading bots can help me in my daily trading.

I'll notify you, should I choose to sell information... the hubs have ears!

Any chance of a cheat sheet to get it running with basic functionality?

adlai commented 4 years ago

Any chance of a cheat sheet to get it running with basic functionality?


;;; after loading scalpl.asd, evaluate (asdf:load-system "scalpl/exch")
;;; where `exch` refers to the specific exchange you wish to use.
;;; after the code has finished compiling, switch to the scalpl.qd package
;;; and evaluate the following form:
(define-maker *any-name-you-choose*
:supplicant (make-instance 'supplicant
:gate (make-instance 'exch:exch-gate
;; provide API credentials
;; as explained above
)
:market (ensure-running (find-market "WTI" :exch)))
:parameter1 value1
:parameter2 value2)
;;; (enable-pretty-printer-abuse) for easier display of values

;;; I recommend that you first do this with an account that does not ;;; have any funds. You are quite likely to encounter the debugger, ;;; possibly multiple times in parallel, due to the fact that the ;;; program spawns several threads simultaneously.

;;; This line should terminate all threads, additionally exiting the debuggers ;;; started by the ones that crashed, and leave you at the regular prompt: (mapc 'kill (mapcar 'task-thread (chanl:pooled-tasks)))


At this point, you can call the standard Common Lisp function, [reinitialize-instance](http://www.lispworks.com/documentation/HyperSpec/Body/f_reinit.htm), with the market maker object stored in the `*any-name-you-choose*` variable, although I recommend that you start by reinitializing the components one by one. These components are the `gate` and `supplicant` instances, and you can access them quickly using a form such as `(slot-reduce *any-name-you-choose* supplicant)`.

For the parameters to the define-maker macro, see https://github.com/adlai/scalpl/blob/master/qd.lisp#L254-L258
You will probably want to modify almost every single hardcoded number that appears in the various class definitions, and possibly even the ones inline in the code (e.g., search for the number `4/3`), although currently only these five parameters are implemented as initial arguments.
adlai commented 4 years ago

I intend only to experiment by the way, I don't expect this to be a magic money maker.

Incidentally, you should not rely on the accounting arithmetic, since it was written for an exchange that has been discontinued by international law enforcement agencies, and other exchanges do not necessarily use equivalent computations.

adlai commented 4 years ago

I'll leave the issue open in case @kyrypto has further questions.

adlai commented 3 years ago

Writing clear documentation is work, of the sort that I am not likely to do myself, neither for money nor pure unadulterated happiness, although I am still open to the idea of compensating someone else to do so.