public static void createInstace(LowLevelNinjaTraderAPI api, int positionSize) { if (theInstace == null) { theInstace = new NTLiveTradingAPI(api, positionSize); } else { throw new Exception("NTLiveTradingAPI Constructor: There is allready an instance"); } }
private NTLiveTradingAPI(LowLevelNinjaTraderAPI api, int positionSize) { this.api = api; this.positionSize = positionSize; api.tickdataArrived += api_tickdataArrived; }
private void connect_nt_btn_Click(object sender, EventArgs e) { ntApi = new LowLevelNinjaTraderAPI(AvailableInstruments.allInstruments, "Sim101"); NTLiveTradingAPI.createInstace(ntApi, 125); //125 per position * 11 strategies = 1375 investement }