Class SpotBacktestingAccount

java.lang.Object
io.runon.trading.backtesting.account.SpotBacktestingAccount
All Implemented Interfaces:
io.runon.trading.account.Account

public class SpotBacktestingAccount extends Object implements io.runon.trading.account.Account
현뮬 백테스팅 계좌
Author:
macle
  • Field Details

  • Constructor Details

    • SpotBacktestingAccount

      public SpotBacktestingAccount(String id)
  • Method Details

    • setFee

      public void setFee(BigDecimal fee)
      수수료 설정 구매수수료와 판매수수료가 같은경우 다른경우는 각각 설정
      Parameters:
      fee - 수수료
    • setBuyFee

      public void setBuyFee(BigDecimal buyFee)
      구매 수수료 설정
      Parameters:
      buyFee - 구매수수료
    • setSellFee

      public void setSellFee(BigDecimal sellFee)
      판매수수료 설정
      Parameters:
      sellFee - 판매수수료
    • setCash

      public void setCash(BigDecimal cash)
    • addCash

      public void addCash(BigDecimal cash)
    • trade

      public void trade(String symbol, io.runon.trading.Trade trade)
    • getBuyFee

      public BigDecimal getBuyFee(SpotBacktestingHolding holding, BigDecimal price, BigDecimal volume)
      매수 수수료 구현된 내용은 종목별로 수수료가 다른경우는 구현되어 있지않음 종목별로 수수료가 다른경우 Override 해서 구현
      Parameters:
      holding - 종목별 수수료가 다른경우 아래 메소드를 오버라이딩 해서 구현 (종목 정보를 얻기위한 용도)
      price - 가격
      volume - 거래량
      Returns:
      수수료
    • getSellFee

      public BigDecimal getSellFee(SpotBacktestingHolding holding, BigDecimal price, BigDecimal volume)
      매도 수수료 구현된 내용은 종목별로 수수료가 다른경우는 구현되어 있지않음 종목별로 수수료가 다른경우 Override 해서 구현
      Parameters:
      holding - 종목별 수수료가 다른경우 아래 메소드를 오버라이딩 해서 구현 (종목 정보를 얻기위한 용도)
      price - 가격
      volume - 거래량
      Returns:
      수수료
    • setSymbolPrice

      public void setSymbolPrice(SymbolPrice symbolPrice)
    • getAssets

      public BigDecimal getAssets()
      계좌 자산
      Specified by:
      getAssets in interface io.runon.trading.account.Account
      Returns:
      cash + holdings
    • getId

      public String getId()
      Specified by:
      getId in interface io.runon.trading.account.Account
    • getCash

      public BigDecimal getCash()
      Specified by:
      getCash in interface io.runon.trading.account.Account