Exemplo n.º 1
0
        private void update_info_timer_Tick(object sender, EventArgs e)
        {
            this.Invoke(new Action(() => {
                string output = "";

                if (NTLiveTradingAPI.getTheInstace() != null)
                {
                    output += Environment.NewLine +
                              "Positionsize: " + NTLiveTradingAPI.getTheInstace().getPositionSize() + Environment.NewLine +
                              "Cash value: " + NTLiveTradingAPI.getTheInstace().getCashValue() + Environment.NewLine +
                              "Buying power: " + NTLiveTradingAPI.getTheInstace().getBuyingPower() + Environment.NewLine;
                }

                output += Environment.NewLine + (ntApi != null ? "NT CONNECTED!" : "no nt connection");

                info_label.Text = output;
            }));
        }
Exemplo n.º 2
0
 public LiveTradingForm(NTLiveTradingAPI api)
 {
     InitializeComponent();
     this.api = api;
 }
Exemplo n.º 3
0
        private void open_trade_form_btn_Click(object sender, EventArgs e)
        {
            LiveTradingForm form = new LiveTradingForm(NTLiveTradingAPI.getTheInstace());

            form.Show();
        }
Exemplo n.º 4
0
 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
 }