com.nodelab.equity

Type TraderVolumes

com.nodelab.0.10179
Instance of Type
Inheriting from Calculator

Type dataValue
org.uninode.Type.displayPatterna {att:org.uninode.Node.type}
org.uninode.Resource.resourceType
org.uninode.Resource.label
org.uninode.Resource.resourceOfList{}
org.uninode.Listable.resourcesReference[org.uninode.Listable.resources] of com.nodelab.equity.TraderVolumes

Attribute summaryDefined inUninode® IdPropertiesDefault
Reference[org.uninode.Listable.resources]resourcesListableorg.uninode.0.2001type
StringtoString
This is the display string.
Nodeorg.uninode.0.102
Typetype
The type of an object determines the behaviour and attributes of the object.
Nodeorg.uninode.0.101
StringuriNodeorg.uninode.0.103
StringlabelResourceorg.uninode.0.2041type
List[Type]resourceOfResourceorg.uninode.0.2042type
SignatureresourceType
This defines the type of resource. It can be 'view', 'adapter' or 'action'
Resourceorg.uninode.0.2043type

Method summaryDefined inOverridesProperties
voidactivateListable
voiddesignEditor(WidgetWorkspace ws)Listable
voidgenerateScript(ScriptGenerationInfo info)
Prepare and generate initialization code
ScriptGenerator
voidinstanceScript(ScriptGenerationInfo info)
return either variable name (like 'ave1', found in info), or a constructor call (new ...)
ScriptGenerator
BooleanisResourceOf(Listable listable, Signature aspect)Mixabletype
ListablemixOn(Mixable mix)Mixable
ListablemixWith(Mixable mix)Mixable
StringresourceStringListableintrospection
voidcom.nodelab.java.view.ActivateViewListable
Intcom.nodelab.java.view.ActorCountView
Actorcom.nodelab.java.view.ActorForSoView
Actorcom.nodelab.java.view.AddSourceSoView
voidcom.nodelab.java.view.ConstructorView
voidcom.nodelab.java.view.DesignViewWWView
Dimensioncom.nodelab.java.view.DimensionAtInView
Intcom.nodelab.java.view.DimensionCountView
Dimensioncom.nodelab.java.view.DimensionTypeTyView
voidcom.nodelab.java.view.DragMouseReReReReView
voidcom.nodelab.java.view.GenerateScriptSIViewScriptGenerator
Actorcom.nodelab.java.view.GetActorInView
voidcom.nodelab.java.view.InstallView
voidcom.nodelab.java.view.InstanceScriptSIViewScriptGenerator
Booleancom.nodelab.java.view.IsPerpetualView
voidcom.nodelab.java.view.PrepareView
Collection[Type]com.nodelab.java.view.RequiredDimensionsView
Scenecom.nodelab.java.view.SceneView
WidgetWorkspacecom.nodelab.java.view.WorkspaceView

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].

*/