Petersoj / alpaca-java

A Java API for Alpaca, the commission free, algo friendly, stock trading broker. https://alpaca.markets
https://petersoj.github.io/alpaca-java/
MIT License
197 stars 82 forks source link

Add trailing stop #69

Closed jetonbacaj closed 3 years ago

Petersoj commented 3 years ago

Looks good. I'll merge this on Friday.

jetonbacaj commented 3 years ago

There is a small issue - the hwm is exposed when creating an order - it shouldn't be so. hwm is an Alpaca-tracked price that cannot be set. That exposure should be removed.

Should I create a new PR with the correction in it (thus this PR needing rejection+deletion)? Or create another PR to go on top of this that corrects this? @Petersoj

Petersoj commented 3 years ago

@jetonbacaj you can just push another commit to your forked repo "trailing_stop" branch and it will be automatically added in this PR. Pretty cool.

jetonbacaj commented 3 years ago

D'oh, of course.

Done!

Petersoj commented 3 years ago

@jetonbacaj I'll merge this when it is released in the official API as there may be more changes to this feature in the future.

jetonbacaj commented 3 years ago

Any chance you can do a beta tag at least? Other than myself, there is at least another person on slack who expressed interest in this functionality. Alpaca already includes this in their official versioned SDKs - if/when something changes, we'll follow suit.

Petersoj commented 3 years ago

@jetonbacaj yeah I can start a snapshot builds repo in maven central.

jembl commented 3 years ago

hey, by any chance you dropped the snapshot builds in maven yet? I cannot seem to see it yet on maven central

Petersoj commented 3 years ago

@jembl this is now available as a snapshot/beta build. Modify the following in your build.gradle file:

repositories {
    mavenCentral()
    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
}

and modifying your dependency path to:

dependencies {
    compile group: 'net.jacobpeterson', name: 'alpaca-java', version: '5.1-SNAPSHOT'
}