Shtick Hustler
Well-known member
- Joined
- Oct 15, 2020
- Posts
- 106
- Likes
- 46
The current version of my strategy was re-written to submit orders directly rather than using the ctx.signal() method, and then call the orders from onSignal() (ala the example study SampleMACrossStrategy.java).
Did this because I was getting intermittent errors saying something like 'signal descriptor does not exist' which would prevent trades from occurring.
Everything is functional with the new Strat and I am able to:
- enter positions
- exit positions
- enter stops after orders fill
- cancel stops after position closes
But, if I resize my chart while Strat is running, it will sometimes start submitting orders...lots and lots of (live) orders (I've only run this in the SIM).
I assume what's happening is that historical trade order submissions are leaking through to realtime and causing order submissions--both stop orders and market entry orders.
Another chart operation that will cause these orders to appear is adding a study.
For example: here's the Strat in nonactive state.
Here it is, active:
Here it is after a resize:
In a matter of seconds it submitted 478 orders that were filled, with many more waiting for a fill.
It seems to me that there should be a firewall between historical trade data and realtime, and this should not happen (assuming it is historical trades that are triggering this).
Of course it's possible something is wrong in my code, but the SDK should have some protection built-in against situations like this, IMO.
Needless to say I can't run this live in its current state. I'd recommend anyone deciding to enable direct order submission in their Strats to test thoroughly before going live.
If anyone has experienced this issue, or has ideas on why this might be happening and how to fix it, I'd appreciate hearing from you.
Did this because I was getting intermittent errors saying something like 'signal descriptor does not exist' which would prevent trades from occurring.
Everything is functional with the new Strat and I am able to:
- enter positions
- exit positions
- enter stops after orders fill
- cancel stops after position closes
But, if I resize my chart while Strat is running, it will sometimes start submitting orders...lots and lots of (live) orders (I've only run this in the SIM).
I assume what's happening is that historical trade order submissions are leaking through to realtime and causing order submissions--both stop orders and market entry orders.
Another chart operation that will cause these orders to appear is adding a study.
For example: here's the Strat in nonactive state.
Here it is, active:
Here it is after a resize:
In a matter of seconds it submitted 478 orders that were filled, with many more waiting for a fill.
It seems to me that there should be a firewall between historical trade data and realtime, and this should not happen (assuming it is historical trades that are triggering this).
Of course it's possible something is wrong in my code, but the SDK should have some protection built-in against situations like this, IMO.
Needless to say I can't run this live in its current state. I'd recommend anyone deciding to enable direct order submission in their Strats to test thoroughly before going live.
If anyone has experienced this issue, or has ideas on why this might be happening and how to fix it, I'd appreciate hearing from you.