예제 #1
0
 public Bot(OrdersOnlineDTO _orderDTO)
 {
     bitmex           = BitmexApiConnector.Instance;
     candleRetriever  = CandleRetriever.Instance;
     botApiCalls      = BotApiCalls.Instance;
     this.orderDTO    = _orderDTO;
     sucessfullOrders = new Dictionary <int, String>();
     stepDOWN         = 0;
     stepUP           = 0;
     isUpTrading      = false;
     isDownTrading    = false;
     semaphoreSlim    = new SemaphoreSlim(1, 1);
 }
예제 #2
0
        public Form1()
        {
            InitializeComponent();
            InitializeDropdownsAndSettings();
            InitializeAPI();
            InitializeSymbolInfromation();
            OrdersOnlineSubject orderSubject = new OrdersOnlineSubject();

            orderDTO = new OrdersOnlineDTO(orderSubject);
            OrderParser orderParser = new OrderParser(orderDTO);
            BSocket     socket      = new BSocket(orderParser);

            System.Threading.Thread thread1 = new Thread(socket.HearthBeat);
            OrdersOnlineSubscriber  sb      = new OrdersOnlineSubscriber(SocketGetOrders);

            SocketGetOrders.DataSource = orderDTO.orderList;
            candleRetriever            = CandleRetriever.Instance;
            bot = new Bot(orderDTO);
            orderSubject.Subscribe(sb);
            orderSubject.Subscribe(bot);
            thread1.Start();
            //Action hearthbeat = () => BSocket.Hearthbeat();
            // Task task = Task.Run(hearthbeat);
        }
예제 #3
0
 private BotApiCalls()
 {
     bitmex           = BitmexApiConnector.Instance;
     candleRetriever  = CandleRetriever.Instance;
     activeInstrument = ActiveInstrument.Instance;
 }