INNER CODE UNIT · Java

handleOrders

qtds35k/HighFrequencyTradingBot · src/trading/Main.java:135

	private static void handleOrders(Map<String, OrderCycle> orderMap) throws IOException, InterruptedException {
		for (Map.Entry<String, OrderCycle> entry : orderMap.entrySet()) {
			OrderCycle order = entry.getValue();
			order.updateOrderStatus();  // SELLs may happen here
		}
		
		// remove those with terminate flags from map
		orderMap.entrySet().removeIf(entry-> entry.getValue().terminate);
	}

	
	private static boolean hasUnboughtOrders(Map<String, OrderCycle> orderMap) {
		for (Map.Entry<String, OrderCycle> entry : orderMap.entrySet()) {
			OrderCycle order = entry.getValue();
			if (order.getState() == 1)
				return true;
		}
		return false;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…