This Indicator exposes two methods that can be called from any indicator or strategy to make a post to BMT.
Current Version: 2.6
There are various overloads to these methods, so you don't need to use all arguments.
The two methods are:
and
Changes:
makepicpost now needs "this.ChartControl" instead of just "this"as argument.
makepost will no longer require "this" as argument.
The first will post a screenshot of the chart it has been called from (with optional message), the second will post a plain message.
Edit: Added a third method, uploadimg(), as the other two it has some overloads.
It returns the url of the img (with image tags) with an event. The event can be used like:
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\BMTAPIKEY.txt
Then put your API key in it, nothing else.
To use these methods you first need to add this line to your variables:
You then can call them like:
There is a custom EventHandlerfor the response error code. You can implement it like this:
1. paste this line into OnStartUp (initializes the EventHandler):
2. create the EventHandler method:
3. paste this line into OnTermination (removes the EventHandler):
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.
Thread for discussion: https://nexusfi.com/elite-circle/24223-big-mike-trading-api-programmers.html
There is also all the info on the API in that thread.
Changelog:
19 Dec 2012
Disabled posting on historical data.
21 Dec 2012
Fixed a bug where other windows in front of the chart got caught in the screenshot. Does not (yet) work with minimized charts.
29 Dec 2012
v1.5
added an error code variable that can be accessed (it is thread safe) from the calling indicator.
v1.6
extended errorcode with 9 = busy.
v1.7
Fixed some stuff in the screenshot code
1. Jan 2013 v1.8
Fixed line break issue. Please use <br> for line breaks.
3. Jan 2013 v1.9
Now also works on minimized charts.
4. Jan 2013 v2.0
Made various overloads of the two methods for easier implementation.
Introduced an EventHandler for the error code.
Possibility to use file with API key when API key is either "" or not specified.
For this to work create the following file:..."Your Home Directory"\Documents\NinjaTrader 7\bin\Custom\BMTAPIKEY.txt
Then put your API key in it, nothing else.
(all no code breaking changes)
15. Jan 2013 v2.1
Corrected bug where price axis got cut off under some circumstances.
01. Feb 2013 v2.2
Changed the indicator argument for makepicpost to ChartControl, so use "this.ChartControl".
Deleted indicator argument for makepost, so this will not require a chart to work.
04. Feb 2013 v2.3
Introduced new argument into all methods (historial) This is the historical check so that a strategy or indicator does not try to post 100 messages when it starts up! Please pass the "Historical" attribute like makepostI(.....this, Historical);
v2.4
fixed bug in makeimgpost()
13. Feb 2013 v2.5
Added method uploadimg()
17. May 2013 v2.6 Critical update, update immediately
Changed addresses from http to https, should work again.
vvhg
Category The Elite Circle
|
|
|