class_docstr: A reward scheme for position-based returns.
  
  * Let :math:`p_t` denote the price at time t.
  * Let :math:`x_t` denote the position at time t.
  * Let :math:`R_t` denote the reward at time t.
  
  Then the reward is defined as,
  :math:`R_{t} = (p_{t} - p_{t-1}) \cdot x_{t}`.
  
  Parameters
  ----------
  price : `Stream`
      The price stream to use for computing rewards.
class_docstr_tok: ["A","reward","scheme","for","position-based","returns",".","*","Let",":","math",":","`","p_t","`","denote","the","price","at","time","t.","*","Let",":","math",":","`","x_t","`","denote","the","position","at","time","t.","*","Let",":","math",":","`","R_t","`","denote","the","reward","at","time","t.","Then","the","reward","is","defined","as",",",":","math",":","`","R_","{","t","}","=","(","p_","{","t","}","-","p_","{","t-1","}",")","\\cdot","x_","{","t","}","`",".","Parameters","--","--","--","--","--","price",":","`","Stream","`","The","price","stream","to","use","for","computing","rewards","."]
code: def on_action(self, action: int) -> None:
      self.position = -1 if action == 0 else 1
  
imports: from abc import abstractmethod
  import numpy
  import pandas
  from tensortrade.env.generic import RewardScheme, TradingEnv
  from tensortrade.feed.core import Stream, DataFeed
  import math
label_desc: Use image node_id 2 for calling the PBR obj's underlying member method code with example usage: obj.on_action(action) without return types