A random graph generator. help

So I am working on an app, where a graph is being drawn every 5 seconds.
And every second the database changes up or down obviously.
Is there a way to build a more advanced algorithm to mirror different, trading modes and
So far I have a graph, and some buttons and a wallet enough to buy one bitcoin and the idea is to
trade your bitcoins in a game sort of realtime.
So I buy a bitcoin and try to predict the movements, and sell and make a few hundred $ or mby lose.
I have realtime quotes as well but want to make some sort of interactive orders
All feedback is welcome!

update(){
 // return this.items.update(this.Bitcoin);
  // setInterval(()=>{
  //   this.timer=this.timer+1
  // },1000)
  this.timer=this.timer+1
  if(this.timer>20){
      this.timer=1
    }
    if(this.timer>=10 )
    { 
      // setInterval(()=>{
      // let x=this.post.USD.rate_float+1
      return this.priv.object('usergollum/gold/bitcoin/USD/rate_float').query.ref.transaction(count => count-111);
     // return this.priv.list('userfollum/gold/bitcoin/USD/rate_float').update('update',x)
   //  },1331)
 
  
  
    }
    if(this.timer<10){
   // setInterval(()=>{
     // let x=this.post.USD.rate_float+1
     return this.priv.object('usergollum/gold/bitcoin/USD/rate_float').query.ref.transaction(count => count+110);
    // return this.priv.list('userfollum/gold/bitcoin/USD/rate_float').update('update',x)
   // },1331)
  
  
    }
    
}