Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1036210 // HoldSide

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9429L/52K).

enum HoldSide {
  SHORT, LONG;

  static HoldSide fromInt(double direction) {
    if (direction > 0) ret LONG;
    if (direction < 0) ret SHORT;
    fail("direction 0");
  }
  
  bool isLong() { ret this == LONG; }
  bool isShort() { ret this == SHORT; }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036210
Snippet name: HoldSide
Eternal ID of this version: #1036210/4
Text MD5: bc30951be333c68aa71043eff69b4bb6
Transpilation MD5: 185d2243f193f9d97c5701174507437a
Author: stefan
Category: javax / trading
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-10-26 05:10:07
Source code size: 267 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 135 / 218
Version history: 3 change(s)
Referenced in: #1003674 - Standard Classes + Interfaces (LIVE continued in #1034167)