Delete Shout with ModReasonCode PartialExecution

Asked by Thomas Radons

I try to delete an old shout before sending a new one.

Is it possible to delete Shouts with ModReasonCode PARTIALEXECUTION.
It cold be a bug. i did not test it out where the problem is, but i am quite sure there are only problems with deletation if PARTIALEXECUTION is in the game.

Question information

Language:
English Edit question
Status:
Answered
For:
tacenergydemo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
David Dauer (ddauer) said :
#1

Q: Why would you want to delete already executed shouts?

Revision history for this message
Thomas Radons (thomas-radons) said :
#2

I want to delete the rest of a shout.
e.g. my shout was about 50 kWh and somebody sold me 30 kWh, there will be 20 kWh open.
I want to delte the partial executed shout with the restQuantity 20 kWh

Revision history for this message
David Dauer (ddauer) said :
#3

Ok, have a look at SubmissionService.groovy in the demo agent. You should see some helper methods for shout operations like update and delete.

Revision history for this message
David Dauer (ddauer) said :
#4

Was that what you're looking for or what exactly is your question?

Revision history for this message
Thomas Radons (thomas-radons) said :
#5

I dont think so,
i am trying to find out if it is my fault or a bug

my agent is able to delete and send new shout, the problem is only after a trade.
I am using the same logic.

Revision history for this message
David Dauer (ddauer) said :
#6

Have you tried running the server locally to see if you're getting any exceptions? Once you delete a shout, you should receive a new shout in response with ModReasonCode.DELETIONBYUSER. Are you receiving that one?

Revision history for this message
Thomas Radons (thomas-radons) said :
#7

I tried some more.

onOrderStatusUpdateReceived

I check if it is a PARTIALEXECUTION and delete it.

In the Log of the client I let me show the shoutID

there is no DELETATIONBYUSER for this shoutID below in the log

Revision history for this message
David Dauer (ddauer) said :
#8

So what you're saying is that you are not receiving an updated shout in onOrderStatusUpdateReceived after you called the delete method with a shout with ModReasonCode.PARTIALEXECUTION?

Also, could you just post the relevant code?

Revision history for this message
Thomas Radons (thomas-radons) said :
#9

def onOrderStatusUpdateReceived(Shout shout, GPathResult gpathSource) {
    log.info "Shout received: ${shout.shoutID} - with Mod ${shout.modReasonCode}"

    if(shout.modReasonCode==ModReasonCode.PARTIALEXECUTION){
      log.info "partialExecution $shout.shoutID"
      submissionService.deleteShout(shout)
    }
}

Fot that I am not receiving further OrderStatusUpdates

Right now I am sure it is a bug and I will post it to the server Bug list

Revision history for this message
Daniel Schnurr (danielschnurr) said :
#10

Could you verify if the shout is not deleted at the server at all or if you just miss an OrderStatusUpdate Notification.

One way would be to check if the orderbook is updated, i.e. the shout is not listed in the book anymore after you sent the deletion.
Or just execute a competition on tacenergy.org so we could check the shout log.

Thank you

Revision history for this message
Thomas Radons (thomas-radons) said :
#11

In my Projekt I (try to) delete all old Shouts before sending a new one. It means I wan only one Position in the orderbook from my agent.
This is how I recognized the fault. After a trade there are two positions in the orderbook.
I tried very to solve this problem for a long time
But after tests like I showed you above I am almost sure it is not my fault.

If you want to check the servers shoutsLogs my Username is Thomas and I took part in a competition yesterday evening.

This is the Code I used:

            List <Shout> shoutList = Shout.findAllByProductAndOutdated(pk.product,false)
            int shoutListSize = shoutList.size()
            int i=0
            //delete all Shouts concerning thisProduct
            //send deleteShout to server and mark deleted shouts with outdated at the local archiv
            while(i<shoutListSize){
              Shout thisShout = shoutList.get(i)
              submissionService.deleteShout (thisShout)
              thisShout.outdated=true

              i++
            }

            //save sent data for comparisson
            pk.sentQuantity = pk.shoutQuantity
            pk.sentPrice = pk.shoutPrice
            pk.shoutId=0

            Shout newShout = new Shout(product: product,
                             remainingQuantity: pk.shoutQuantity,
                                    limitPrice: pk.shoutPrice,
                              buySellIndicator: pk.role,
                                     orderType: OrderType.LIMIT)

            submissionService.submitShout(newShout)
            newShout.discard()

It should delete all old Shouts to a specified product but it doesn't, and send a new one.

In the orderbook it is a very common picture that one agent has two positions, but I expect and try to force the agent to have only one position at a time

Best regards

Can you help with this problem?

Provide an answer of your own, or ask Thomas Radons for more information if necessary.

To post a message you must log in.