Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong message on trailing stop buy activation #810

Open
konqueror1 opened this issue Apr 1, 2020 · 9 comments
Open

Wrong message on trailing stop buy activation #810

konqueror1 opened this issue Apr 1, 2020 · 9 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@konqueror1
Copy link

Describe the bug
I am adding a trailing stop buy order for LTC/USDT with initial stop 37.1 and limit price 37. Current price is ~37.5. When submit the stop executes immediately with this in the log:

Trailing stop on binance LTC/USDT market hit stop price (37.57000000 < 37.10)
It is obvious that 37.57 is not less than 37.10.

Tested with the latest official release 0.15.2 and with bleeding-edge snapshot 0.15.3-SNAPSHOT

Expected behavior
I expect the order execution to happen when current price >= 37.1

@konqueror1 konqueror1 added awaiting triage Bugs awaiting developer initial investigation bug Something isn't working labels Apr 1, 2020
@badgerwithagun
Copy link
Member

I think it's just the message that's wrong. The code does this:

if
 job.direction = SELL and ticker.bidPrice <= stopPrice
or
 job.direction = BUY and ticker.askPrice >= stopPrice

But it always uses the same message.

Code here.

It's a very simple fix.

@badgerwithagun badgerwithagun added good first issue Good for newcomers and removed awaiting triage Bugs awaiting developer initial investigation labels Apr 1, 2020
@badgerwithagun badgerwithagun changed the title Wrong trailing stop on binance calculation Wrong message on trailing stop buy activation Apr 12, 2020
AwooOOoo added a commit to AwooOOoo/orko that referenced this issue Aug 12, 2020
@AwooOOoo
Copy link
Contributor

Hi Graham,
I new to the Circleci pipeline and saw it reported that the build failed. It compiled locally with Maven, could you give me some pointers as to what I missed?

Paul

@AwooOOoo
Copy link
Contributor

Ok Fixed that...Stale POM snapshots 0.15.2 vs. 0.15.3. Now it compiles, but integration testing fails. When I run the integration tests locally, I get the following error repeated:

ERROR [2020-08-14 19:01:10,535] com.gruelbox.orko.auth.ipwhitelisting.IpWhitelistingService: Access attempt from [127.0.0.1] not whitelisted

How do I add IP whitelisting to get the tests to run?

@badgerwithagun
Copy link
Member

Hey @AwooOOoo. Check out the file start-integration-test.sh which shows how to run the app with the integration test specific configuration. In the IDE you just need to run the main class with server ../integration-test-config.yml (or something like that) in the IDE's run configuration.

@AwooOOoo
Copy link
Contributor

@badgerwithagun, I was running start-integration-test.sh (command line) when I get the above-listed error repeatedly.

@badgerwithagun
Copy link
Member

Try mvn -Pe2etest verify.

That starts up an instance of the app and runs the tests in the same way as on CircleCI, which we know works.

Does that work for you?

@AwooOOoo
Copy link
Contributor

It runs, but now I am seeing a failure in Orko Job tests... (good times)

[ERROR] Failures: 
[ERROR]   TestJobExecution.testFailOnStopNonResident:235 
Wanted but not invoked:
statusUpdateService.status("JOB1", SUCCESS);
-> at com.gruelbox.orko.jobrun.TestJobExecution.testFailOnStopNonResident(TestJobExecution.java:235)
Actually, there were zero interactions with this mock.

[INFO] 
[ERROR] Tests run: 30, Failures: 1, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Orko 0.15.3-SNAPSHOT:
[INFO] 
[INFO] Orko ............................................... SUCCESS [  0.023 s]
[INFO] Orko Base .......................................... SUCCESS [ 15.519 s]
[INFO] Orko DB Testsupport ................................ SUCCESS [  0.771 s]
[INFO] Orko Auth .......................................... SUCCESS [ 33.167 s]
[INFO] Orko Job ........................................... FAILURE [01:22 min]
[INFO] Orko Common ........................................ SKIPPED
[INFO] Orko Monolith Application .......................... SKIPPED
[INFO] Orko End-to-End Tests .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:12 min
[INFO] Finished at: 2020-08-15T12:46:22+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project orko-job: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/paul/Code/tmp/orko/orko-job/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :orko-job

@badgerwithagun
Copy link
Member

Exactly the same as here:

https://circleci.com/workflow-run/62b4f5fc-8447-4ed6-9e01-c672cffb59c0

So it's not you! Looks like something changed between the old 5.0.0 version of XChange it last successfully built against and 5.0.0. fun times as you say...

@AwooOOoo
Copy link
Contributor

It looks like the following test cases are the ones with issues:

Orko Job: testFailOnStopNonResident() - 1 Error (TestJobExecution.testFailOnStopNonResident:235
Wanted but not invoked:
statusUpdateService.status("JOB1", SUCCESS);
-> at com.gruelbox.orko.jobrun.TestJobExecution.testFailOnStopNonResident(TestJobExecution.java:235)
Actually, there were zero interactions with this mock.)

Orko Common: testSubscriptionsDirect() - 2 Errors (Timed out waiting for SubscriptionControllerImpl)
Orko Common: TestEventBusSubscriptionDifferentSubscriberInner() - 2 Errors (Timed out waiting for SubscriptionControllerImpl)
Orko Common: testEventBusSubscriptionSameSubscriber() - 2 Errors (Timed out waiting for SubscriptionControllerImpl)
Orko Common: testEventBusSubscriptionDifferentSubscriberOuter() - 1 Error (Timed out waiting for SubscriptionControllerImpl)

badgerwithagun pushed a commit that referenced this issue Aug 19, 2020
* -Fix for #810, wrong message on soft trailing stop.

* -updated orko-parent snapshots

* -Changed the Xchange version from the 5.0.0-SNAPSHOT to 5.0.0

* Commented out Hidden Order integration tests

* -Potential fix for 'Hidden orders' test failure
badgerwithagun added a commit that referenced this issue Aug 29, 2020
* -Fix for #810, wrong message on soft trailing stop.

* -updated orko-parent snapshots

* -Changed the Xchange version from the 5.0.0-SNAPSHOT to 5.0.0

* Commented out Hidden Order integration tests

* -Potential fix for 'Hidden orders' test failure

* -Added Balance support to scripting Engine #983

* -Moved method to Events. (#983)

* -Added Open Order (#984) and Orderbook support to the script script engine

* -UserTrade Support to Script Engine

* -Split 'on' calls (onTick, onBalance, onOpenOrders, onOrderBook, onUserTrades) for clarity

* -Added DisposableSubscription class to clean up subscription cleanup returns.
- Cleaned up some warnings reported by IntelliJ

* - More clean up (missing final's, incorrect pattern usage)

* Review change

* Typo

Co-authored-by: Graham Crockford <[email protected]>
Co-authored-by: Graham Crockford <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants