Demo strategies: QuotesDelta Indicator

Custom indicators, trading strategies, data export and recording and more...
SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Demo strategies: QuotesDelta Indicator

Post by SuperDriveGuy » Thu Nov 29, 2018 6:56 pm

Had to start afresh, that error is resolved. Please ignore the previous message.

I will update with any feedback later

Thanks

Tags:

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Demo strategies: QuotesDelta Indicator

Post by SuperDriveGuy » Thu Nov 29, 2018 7:13 pm

Hi Serg,
The figures don't seem to add up.

I am limiting the ES levels to 10 for calculation purposes. I would expect the Quotes Delta totals for 10 levels, which the Quotes Delta column shows as
18 contracts were pulled from the bid
65 contract were added on the ask

Neither the Quotes Size Delta nor the Quotes Count Delta are near the figure. I do understand, there could be a small lag between when all the figures line up, but I have observed even on a SLOW(in the evening) FESX too.

is the Quotes Delta 4 code similar to the code used in the "Quotes Delta" column?
Annotation 2018-11-29 200615.jpg
Annotation 2018-11-29 200615.jpg (495.56 KiB) Viewed 22536 times

Serg
Posts: 113
Joined: Mon Jun 11, 2018 12:40 pm
Has thanked: 15 times
Been thanked: 35 times

Re: Demo strategies: QuotesDelta Indicator

Post by Serg » Thu Nov 29, 2018 9:45 pm

The code is different and wasn't purposed to measure exactly the same. But I adjusted it where possible to make the same. You can download the updated jar from the same link. Here are few items to consider:
  • The indicator counted levels from zero, so limit of 10 actually meant 11 levels. This is now updated.
  • The Quotes delta column ignores quotes updates which are assumed to be removals because they were traded. So, we can use trades data to compensate on such removals (which are not cancellations). I updated the indicator accordingly.

    Code: Select all

    	@Override
    	public void onTrade(double price, int size, TradeInfo tradeInfo) {
    		if (tradeInfo.isBidAggressor) {
    			askDeltaSize += size;
    			askDeltaCount++;
    		} else {
    			bidDeltaSize += size;
    			bidDeltaCount++;
    		}
    	}
    
  • Quotes delta column resets all ask values to zero when best ask changes, and resets all bid values to zero when best bid changes. This is the main difference from Quotes delta indicator, which keeps summing up the quotes updates regardless of price changes.
  • Because of the above you can compare them only during time periods when price doesn't change.
  • Because the quotes delta column resets on price changes, it's a short-term indicator which takes into account only the visible time range on the chart. So, you need to have the last price change in the visible range if you wish to compare the two.
Given all the above, the values match precisely except few places (probably paused in the middle of a series of updates).

diff.png
diff.png (31.89 KiB) Viewed 22536 times
Attachments
ESZ8.CME@RITHMIC_screenshot_20181003_170317_105.png
ESZ8.CME@RITHMIC_screenshot_20181003_170317_105.png (149.33 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170317_576.png
ESZ8.CME@RITHMIC_screenshot_20181003_170317_576.png (149.27 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170319_679.png
ESZ8.CME@RITHMIC_screenshot_20181003_170319_679.png (151.75 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170319_864.png
ESZ8.CME@RITHMIC_screenshot_20181003_170319_864.png (149.12 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170322_209-000.png
ESZ8.CME@RITHMIC_screenshot_20181003_170322_209-000.png (154.59 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170334_117-001.png
ESZ8.CME@RITHMIC_screenshot_20181003_170334_117-001.png (147.82 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170342_684.png
ESZ8.CME@RITHMIC_screenshot_20181003_170342_684.png (159.78 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170406_548.png
ESZ8.CME@RITHMIC_screenshot_20181003_170406_548.png (170 KiB) Viewed 22536 times
ESZ8.CME@RITHMIC_screenshot_20181003_170438_741.png
ESZ8.CME@RITHMIC_screenshot_20181003_170438_741.png (169.54 KiB) Viewed 22536 times

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Demo strategies: QuotesDelta Indicator

Post by SuperDriveGuy » Fri Nov 30, 2018 9:00 am

Hi Serg,
Great quick response!

To keep my reply in context, I have used your post as a basis.

----------------------------------
The code is different and wasn't purposed to measure exactly the same. But I adjusted it where possible to make the same. You can download the updated jar from the same link. Here are few items to consider:
----------------------------------
I downloaded the new jar. Thanks.
My Question would be, If QuotesDelta indicator purpose is not be same as the column QuotesDelta ....
would it be possible to create a copy say "Quotes Delta Historical" which would be exactly the same as the QuotesDelta column, reset on price change etc, so basically it would be a line chart representation of what the quotes delta column sum of levels reports in real time. Absolutely crucial would be the sum of levels on bid - sum of levels on ask.
Annotation 2018-11-30 095122.jpg
Annotation 2018-11-30 095122.jpg (549.16 KiB) Viewed 22534 times
-----------------------------------
Quotes delta column resets all ask values to zero when best ask changes, and resets all bid values to zero when best bid changes. This is the main difference from Quotes delta indicator, which keeps summing up the quotes updates regardless of price changes.
-----------------------------------
I think this reset is valuable, when charted across time, this is in time snapshot as to the price movement, BEFORE price moved, the position of bids/asks removed/added

---------------------------------
Because the quotes delta column resets on price changes, it's a short-term indicator which takes into account only the visible time range on the chart. So, you need to have the last price change in the visible range if you wish to compare the two.
-----------------------------------
Normally I would view this in a 30 mins to 1 hour window, maybe even more, its the graphical historical representation of the Quotes Delta Sum(of levels), which would indicate what happened, when x number of contracts were added or pulled on the bid/ask.

I hope I have been able to convey my thoughts. Looking forward to your response.

Regards,

SDG

Serg
Posts: 113
Joined: Mon Jun 11, 2018 12:40 pm
Has thanked: 15 times
Been thanked: 35 times

Re: Demo strategies: QuotesDelta Indicator

Post by Serg » Tue Dec 04, 2018 4:15 pm

Hi,
I added a checkbox that makes it reset on every price change, you can download it here. Personally, I don't find this mode very useful for chart trading, but it's up to you.

kahwai
Posts: 9
Joined: Fri Dec 07, 2018 12:55 am
Been thanked: 1 time

Re: Demo strategies: QuotesDelta Indicator

Post by kahwai » Tue Dec 11, 2018 4:10 pm

I received this error when activate it
Attachments
error.png
error.png (58.7 KiB) Viewed 22468 times

Svyatoslav
Site Admin
Posts: 278
Joined: Mon Jun 11, 2018 11:44 am
Has thanked: 2 times
Been thanked: 31 times

Re: Demo strategies: QuotesDelta Indicator

Post by Svyatoslav » Tue Dec 11, 2018 4:12 pm

Hi, what is the feed you are using it on? I've noticed that you created another topic, about DxFeed - indicators are blocked with DxFeed due to restrictions imposed by exchanges, but there is a good chance blocking isn't always working cleanly.
kahwai wrote:
Tue Dec 11, 2018 4:10 pm
I received this error when activate it

kahwai
Posts: 9
Joined: Fri Dec 07, 2018 12:55 am
Been thanked: 1 time

Re: Demo strategies: QuotesDelta Indicator

Post by kahwai » Tue Dec 11, 2018 5:21 pm

I subscribed to DXFeed, I guess the blocking caused this issue.
Svyatoslav wrote:
Tue Dec 11, 2018 4:12 pm
Hi, what is the feed you are using it on? I've noticed that you created another topic, about DxFeed - indicators are blocked with DxFeed due to restrictions imposed by exchanges, but there is a good chance blocking isn't always working cleanly.
kahwai wrote:
Tue Dec 11, 2018 4:10 pm
I received this error when activate it

mdtrader
Posts: 39
Joined: Sat Oct 27, 2018 4:05 pm
Location: germany
Has thanked: 12 times
Been thanked: 41 times

Re: Demo strategies: QuotesDelta Indicator

Post by mdtrader » Fri Dec 14, 2018 10:38 am

Hi Serg,
if I try to load your jar file I got this error:

Code: Select all

java.lang.NullPointerException
	at velox.api.layer1.simplified.SimplifiedL1ApiLoader.onOrderExecuted(SimplifiedL1ApiLoader.java:1580)
	at velox.bookmap.dX.onOrderExecuted(SourceFile:254)
	at velox.bookmap.fc.a(SourceFile:171)
	at velox.bookmap.de.a(SourceFile:41)
	at velox.bookmap.fc.onOrderExecuted(SourceFile:171)
	at velox.bookmap.dZ.a(SourceFile:1100)
	at velox.bookmap.bo.a(SourceFile:326)
	at velox.bookmap.bo.a(SourceFile:167)
	at velox.bookmap.bo.b(SourceFile:454)
	at velox.bookmap.bo.a(SourceFile:421)
	at velox.bookmap.CP.a(SourceFile:526)
	at velox.bookmap.CP.a(SourceFile:8427)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6533)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at velox.bookmap.MB.dispatchEvent(SourceFile:606)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Serg
Posts: 113
Joined: Mon Jun 11, 2018 12:40 pm
Has thanked: 15 times
Been thanked: 35 times

Re: Demo strategies: QuotesDelta Indicator

Post by Serg » Fri Dec 14, 2018 10:57 am

mdtrader wrote:
Fri Dec 14, 2018 10:38 am
Hi Serg,
if I try to load your jar file I got this error:
I suppose you are loading Quotes Delta 5, correct? Just tried to reproduce, but didn't get errors. What is your Bookmap build number (Help->About)?

Post Reply