Constructor
new KaplanSniperAgent(optionsopt)
Create KaplanSniperAgent
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
options passed to Trader and Agent constructors
Properties
|
Classes
Methods
isLowSpread()
Calculates price this agent is willing to pay.
The returned price always equals either undefined or the price of market.currentAsk(), triggering an immediate trade.
The KaplanSniperAgent will buy, if market.currentAskPrice<=marginalValue, during one of three conditions:
(A) market ask price is less than or equal to .getJuicyAskPrice(), which needs to be set at the simulation level to the previous period low trade price
(B) when spread = (market ask price - market bid price) is less than or equal to agent's desiredSpread (default: 10)
(C) when period is ending