I need to ask something..
I would like to create little system for remote trading and I need to ask if there is any API for ninjatrader.
I mean I will have any client terminal and server terminal and the server will calculate the the strategy and after this calculation will send EnterLong and EnterShort command back to client. This client should call the EnterLong and EnterShort methods as I am using in NinjaScript..
I will use this remote trading calculating for live trading and also for backtesting.
So when the server terminal will decide to enter new long trade, it will send this information via C# tcp networking to client terminal and this CLIENT terminal HAS TO EXECUTE (in other words - has to call) the EnterLong and EnterShort methods..
I know how to implement the client-server application model and the c# networking will be also no problem (i am experienced java programmer) but I cant imagine how I will call the EnterLong method on the NinjaTrader.
I was thinking I could create strategy listening on any port, and in the OnBarUpdate will be something like this:
OnBarUpdate() {
listening on port.
receive any instruction (for example enter long)
switch (instruction_id) {
case ENTER_LONG: EnterLong(); break;
case SOMETHING_ELSE: else operation; break;
}
}
etc
Can you tell me your opition on this solution or advice me somethig more effective? Is there any API in NinjaTrader to do this not via strategy and OnBarUpdate method etc..?
And last question..: what will happend when the strategy will listen on port for example for 5minutes but the strategy is running on 1minute timeframes.
There should be called this OnBarUpdate method five-times.
What will happen, when the calculation of OnBarUpdate is too long and there are new incomming bars.. ?
Thank you

Comment