Bussinesscycles v19
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
breed [fundamentals fundamental] breed [trendfollowers trendfollower] fundamentals-own [ stock ] trendfollowers-own [ stock ] turtles-own [ pricepaid profit; changed in v10 ] globals [ pricet pricet-1 pricet-2 pricet-3 fundamentalvalue trendedvalue purchase? pricetx novolume? dividendlist dividend fundamentalistsvalue portiontrendfollowers ] to setup __clear-all-and-reset-ticks set-default-shape fundamentals "house" set-default-shape trendfollowers "person" create-ordered-fundamentals Numberoffundamentals [setxy random-ycor random-xcor set color white] create-ordered-trendfollowers Numberoftrendfollowers [setxy random-ycor random-xcor set color white] set pricet 350 ; changed in v10 set pricet-1 350; changed in v10 set pricet-2 350 set pricet-3 350 set trendedvalue 350; changed in v10 set fundamentalvalue 350; changed in v10 set fundamentalistsvalue 350 setup-plots; changed in v10 update-plots ; changed in v10 ask fundamentals [set stock noStocksperTrader set fundamentalistsvalue 350] set portiontrendfollowers (count trendfollowers / (count fundamentals + count trendfollowers)) ask trendfollowers [set stock noStocksperTrader ] set novolume? 0 ask turtles [set profit 0 ] set dividendlist [36 4 -16 -24] end to go if ticks >= timePeriods [stop] ; changed in v10 set dividend one-of dividendlist set fundamentalvalue fundamentalvalue + changeinfundamentalvalue ask fundamentals [ifelse ticks < 15 [ set fundamentalistsvalue fundamentalvalue + (dividend * (((16 - ticks) / 16) * riskattitude))] [set fundamentalistsvalue fundamentalvalue]] set pricet-3 pricet-2 set pricet-2 pricet-1 set pricet-1 pricet ask fundamentals [recolorf] ask-concurrent trendfollowers [buyorsell] set pricet median [pricepaid] of trendfollowers tick end to buyorsell without-interruption [ set purchase? 0 ifelse ticks > 0 [ifelse novolume? >= 1 and mean [stock] of trendfollowers != 0 [set trendedvalue trendedvalue - (2 / count trendfollowers) * novolume? ^ 2][set trendedvalue (pricet-1 - pricet-2) + 0.2 * (pricet-2 - pricet-3) + pricet-1 ]][set trendedvalue 350] ;changed to 2 / count in v 13 recolortrend if any? fundamentals with [stock > 0] and trendedvalue > fundamentalistsvalue [set purchase? 1] if stock > 0 and trendedvalue < fundamentalistsvalue [set purchase? -1] if purchase? = 1 [ ask one-of fundamentals with [stock > 0 ] [set stock stock - 1]] if purchase? = -1 [ ask one-of fundamentals [set stock stock + 1]] if purchase? = 0 [set novolume? novolume? + 1] if purchase? = 1 [set stock stock + 1 set novolume? 0] if purchase? = -1 [set stock stock - 1 set novolume? 0] if purchase? = 1 [set pricepaid (portiontrendfollowers * (trendedvalue - fundamentalistsvalue)) + fundamentalistsvalue set profit profit + (350 - pricepaid); changed in v10 ] if purchase? = -1 [set pricepaid ((1 - portiontrendfollowers) * (fundamentalistsvalue - trendedvalue)) + trendedvalue set profit profit + (pricepaid - 350)]; changed in v10 if purchase? = 0 [ if mean [stock] of trendfollowers = 0 [set pricepaid fundamentalistsvalue] if mean [stock] of fundamentals = 0 [set pricepaid trendedvalue] ;if mean [stock] of trendfollowers != 0 and mean [stock] of fundamentals != 0 [set pricepaid ((1 - portiontrendfollowers) * (fundamentalistsvalue - trendedvalue)) + trendedvalue ] ; waarom deze? ] ] end to recolorf ifelse fundamentalistsvalue > pricet-1 [set color blue][set color red] end to recolortrend ifelse trendedvalue > pricet-1 [set color blue][set color red] end
There is only one version of this model, created over 11 years ago by Jean van Haperen.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Bussinesscycles v19.png | preview | Preview for 'Bussinesscycles v19' | over 11 years ago, by Jean van Haperen | Download |
This model does not have any ancestors.
This model does not have any descendants.