vvhg has made a NinjaTrader automatic poster for screenshots and text:
There are various overloads to these methods, so you don't need to use all arguments.
The two methods are:
and
The first will post a screenshot of the chart it has been called from (with optional message), the second will post a plain message.
There is the possibility to use a specific file with your API key in it when API key is either "" or not specified in the calling method.
For this to work create the following file:..."Your Home Directory"\Documents\NinjaTrader 7\bin\Custom\nexusfi.com (formerly BMT)APIKEY.txt
Then put your API key in it, nothing else.
To use these methods you first need to add this line to your variables:
private vvnexusfi.com (formerly BMT)AutoPost myposter = new vvnexusfi.com (formerly BMT)AutoPost();
You then can call them like:myposter.makepost(...
and myposter.makeimgpost(...
There is a custom EventHandlerfor the response error code. You can implement it like this:
1. paste this line into OnStartUp (initializes the EventHandler):
myposter.ErrorCodeChange += new vvnexusfi.com (formerly BMT)AutoPost.ErrorCodeChangedEventHandler(MyErrorCodeChangedEvent);
2. create the EventHandler method:
private void MyErrorCodeChangedEvent(object sender, ErrorCodeChangeEventArgs error)
{
//do whatever you want here...
Print ("Change detected "+error.ErrorCode);//this prints the change detect and the error code
}
3. paste this line into OnTermination (removes the EventHandler):
myposter.ErrorCodeChange -= new vvnexusfi.com (formerly BMT)AutoPost.ErrorCodeChangedEventHandler(MyErrorCodeChangedEvent);
The error codes are:
0 = no error
1 = Upload to BMCharts failed
2 = Web Client Exception
3 = Time constraint or wrong API key
4 = (not set yet)
5 = other not closer specified error in makeimgpost
6 = tried posting on historical data
9 = busy
Please use the provided EventHandler to do stuff on errors as an error will not occur the moment the method is called but maybe a few seconds later.
vvhg
Example of R code to post on nexusfi.com (formerly BMT) through nexusfi.com (formerly BMT) API: Example of Java code to post on nexusfi.com (formerly BMT) through nexusfi.com (formerly BMT) API: Example of code in Java in order to upload a picture (previously saved on the computer) to bmcharts, for instance in order to later include it into a message automatically posted on nexusfi.com (formerly BMT) though nexusfi.com (formerly BMT) API: Example of code in R (relying on a JAR file) in order to upload the picture of a chart produced by R to bmcharts, for instance in order to later include it into a message automatically posted on nexusfi.com (formerly BMT) though nexusfi.com (formerly BMT) API: Example of code in R to upload the picture of a chart produced by R to bmcharts, for instance in order to later include it into a message automatically posted on nexusfi.com (formerly BMT) though nexusfi.com (formerly BMT) API: