Stock Market Predictor

No preview image

1 collaborator

Me Shamiq Islam (Author)

Tags

economics 

Tagged by Tim Denton about 12 years ago

Model group EECS-372 Spring 2009 | Visible to everyone | Changeable by the author
Model was written in NetLogo 4.1beta3 • Viewed 1702 times • Downloaded 128 times • Run 23 times
Download the 'Stock Market Predictor' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This section could give a general understanding of what the model is trying to show or explain.

HOW IT WORKS

This section could explain what rules the agents use to create the overall behavior of the model.

HOW TO USE IT

This section could explain how to use the model, including a description of each of the items in the interface tab.

THINGS TO NOTICE

This section could give some ideas of things for the user to notice while running the model.

THINGS TO TRY

This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.

EXTENDING THE MODEL

This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.

NETLOGO FEATURES

This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [stocks stock]

stocks-own[
  symbol
  open-price
  daily-high
  daily-low
  close-price
  current-price
  volatility
  ]
globals[
  current-stock
]

to setup
  create-stocks 100 
    [set color grey
    set shape "circle"
    set size 2 ]
  set-prices
  set-locations
  ;;file-open user-file
  ;;set current-stock (list)
  ;;repeat 7
  ;;[ set current-stock lput file-read current-stock]
  ;;format-data
  ;;print current-stock
end 

to go
   stock-interaction
   update-stock
end 

to clear
  ca
  file-close-all
end 

to update-stock
  ask stocks[
    set xcor (xcor + .1)
    set ycor current-price
  ]
  update-stats
end 

to set-locations
  ask stocks [
    set xcor min-pxcor
    set ycor current-price
  ]
end 

to format-data
 set current-stock remove-item 0 current-stock
 set current-stock remove-item 5 current-stock
end 

to set-prices
  ask stocks [
    set current-price ((random  100) + 1)
    set open-price current-price
    set volatility ((random 100) + 1)
    set daily-low current-price
    set daily-high current-price
    ]
end 

to update-stats
   ask stocks[
      if current-price < daily-low
    [set daily-low current-price]
    if current-price > daily-high
    [set daily-high current-price]
   ]
end 

to stock-interaction
  ask stocks[
    ask other stocks
    [ifelse
      ((volatility > ([volatility] of myself)) and (current-price > [current-price] of myself))
      [sell-stock]
      [buy-stock]
    ]
  ]
end 

to sell-stock
  set current-price (current-price - (.001 * volatility) * current-price)
  set color red
end 

to buy-stock
  set current-price (current-price + (.01 * volatility) * current-price)
  set color green
end 

There are 7 versions of this model.

Uploaded by When Description Download
Shamiq Islam almost 14 years ago (Default description) Download this version
Shamiq Islam almost 14 years ago Final Download this version
Shamiq Islam almost 14 years ago (Default description) Download this version
Shamiq Islam almost 14 years ago Initial upload Download this version
Shamiq Islam almost 14 years ago HubNet integration begun Download this version
Shamiq Islam almost 14 years ago (Default description) Download this version
Shamiq Islam almost 14 years ago (Default description) Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.