com.nodelab.equity | ![]() |
com.nodelab.0.10179
Instance of Type
Inheriting from Calculator
Type data | Value |
org.uninode.Type.displayPattern | a {att:org.uninode.Node.type} |
org.uninode.Resource.resourceType | |
org.uninode.Resource.label | |
org.uninode.Resource.resourceOf | List{} |
org.uninode.Listable.resources | Reference[org.uninode.Listable.resources] of com.nodelab.equity.TraderVolumes |
Attribute summary | Defined in | Uninode® Id | Properties | Default | |
Reference[org.uninode.Listable.resources] | resources | Listable | org.uninode.0.2001 | type | |
String | toString This is the display string. | Node | org.uninode.0.102 | ||
Type | type The type of an object determines the behaviour and attributes of the object. | Node | org.uninode.0.101 | ||
String | uri | Node | org.uninode.0.103 | ||
String | label | Resource | org.uninode.0.2041 | type | |
List[Type] | resourceOf | Resource | org.uninode.0.2042 | type | |
Signature | resourceType This defines the type of resource. It can be 'view', 'adapter' or 'action' | Resource | org.uninode.0.2043 | type |
Script summary |
com.nodelab.0.10384/* (aBaliPluginTable tableAspect value = #traderVolumes or: [aBaliPluginTable tableAspect value = #traderVolumesSpan]) ifTrue: [ aBaliPluginTable tableAspect value = #traderVolumes ifTrue: [ from := BaliTime fromSeconds: (aBaliPluginTable display dimHistory focus daysStart asSeconds + (3600 * 10)). to := aBaliPluginTable display dimHistory focus daysEnd] ifFalse: [ from := BaliTime fromSeconds: (aBaliPluginTable display dimHistory from daysStart asSeconds + (3600 * 10)). to := aBaliPluginTable display dimHistory to daysEnd. (Dialog confirm: 'You want to scan the period ' , (from printType: #day) , ' to ' , (to printType: #day) , '?') ifFalse: [^nil]]. list := List new. buyVol := 0. buyValue := 0. env := aBaliPluginTable display envDimensions. last := self valueAspect: #value environment: env. self musician tradersFrom: from to: to block: [:an | list add: (an at: 1) , ' '. list add: (GotheTools formatInteger: (an at: 2)) , ' '. buyVol := buyVol + (an at: 2). buyValue := buyValue + (an at: 3). (an at: 2) > 0 ifTrue: [aveBuy := (an at: 3) / (an at: 2)] ifFalse: [aveBuy := 0]. list add: (GotheTools formatFloat: aveBuy digits: 2) , ' '. list add: (GotheTools formatInteger: (an at: 4)) , ' '. (an at: 4) > 0 ifTrue: [aveSell := (an at: 5) / (an at: 4)] ifFalse: [aveSell := 0]. list add: (GotheTools formatFloat: aveSell digits: 2) , ' '. list add: (GotheTools formatInteger: ((an at: 2) - (an at: 4))) , ' '. (an at: 2) > (an at: 4) ifTrue: [list add: (GotheTools formatFloat: aveBuy digits: 2) , ' '.] ifFalse: [list add: (GotheTools formatFloat: aveSell digits: 2) , ' '.]. (an at: 2) > (an at: 4) ifTrue: [ profit := (an at: 4) * (aveSell - aveBuy). value := ((an at: 2) - (an at: 4)) * (last - aveBuy)] ifFalse: [ profit := (an at: 2) * (aveSell - aveBuy). value := ((an at: 4) - (an at: 2)) * (aveSell - last)]. list add: (GotheTools formatFloat: profit digits: 2) , ' '. list add: (GotheTools formatFloat: value digits: 2) , ' '. list add: (an at: 1) , ' '.]. list add: ''; add: (GotheTools formatInteger: buyVol) , ' '; add: (GotheTools formatFloat: buyValue digits: 2). list add: ''; add: 'ave ' , (GotheTools formatFloat: buyValue / buyVol digits: 2) , ' '; add: ''; add: ''; add: ''. list add: 'last ' , (GotheTools formatFloat: last digits: 2) , ' '; add: ''. list add: aBaliPluginTable firstSource name , ' '. list add: (from printType: #hour) , ' -' , ' '. list add: (to printType: #hour) , ' '. list addAll: #('' '' '' 'timestamp '). list add: (self server now printType: #hour) , ' '. list add: ''; add: ''. aBaliPluginTable tableList: (TwoDList on: list columns: 10). aBaliPluginTable table columnLabelsFormats: #right. aBaliPluginTable table elementFormats: #right. aBaliPluginTable table columnLabelsArray: #('trader ' 'buy volume ' 'buy price ' 'sell volume ' 'sell price ' 'net volume ' 'net price ' 'cash profit ' 'poss. profit' ''). ^nil]. */ |