Wednesday, January 21, 2015

thinkscript included: %bid custom watchlist-column

one of the bits of thinkscript that i use every morning in the premarket is a custom column in my watch list called '%bid', here's the picture:
a watchlist with the %bid custom column
%bid compares the the current market bid to the last closing price expressed as a percentage. very simple, but it has helped me enhance profits many times. how? i sort my watchlist by %bid and that allows me to rapidly identify one of my positions that is gapping up before the market opens. this affords me the opportunity to cancel whatever exit trade i have in place and follow the equity in question during the opening hours. maybe it is one of the rare gap-and-go stocks and runs up all day. here's the code:



plot x=round(100 * ((bid / close) - 1),1) ;
x.assignValueColor( if bid<close then color.RED else color.DARK_GREEN);

unfortunately, i can't wrap this one into a chart study because the chart version of thinkscript doesn't understand what bid is.

here's how to install a custom column:
  1. right click on the heading of the watchlist and select Customize
  2. scroll down the Available Items list and double left-click on the scroll icon of any Custom column
  3. in the Custom Quote Formula dialogue, select the ThinkScript Editor tab
  4. in the editor textbox replace SimpleMovingAvg() with a cut-n-paste of the thinkscript above. 
  5. in the Column Name entry box select a reasonable column name such as "% bid" (not too many characters) the column name is also the text of the column heading. 
  6. click ok
  7. select the "% bid" column from the Available Items list and click the Add Item button
  8. click ok

No comments:

Post a Comment