Take a picture of the chart

screenshot_chartChanges the chart

The app takes a picture of your chart, with your indicators, so it can look at it and adjust the view. Your own chart is not changed.

Details#

Take a picture of the member's chart and get it back as an image you can look at. It is the chart page the member sees, drawn by a browser with the layout's saved indicators: candles, indicator panes, legend and axes. Use it to check how the chart looks, adjust the view and take it again, then keep a good one for a guide with attach_screenshot_to_guide. It does not change the chart on the member's screen or the saved layout. The time axis and the price axis are set for this picture only. The time axis is one of from and to, bars, or reset (the default if you pass none of them), exactly as in set_visible_range. The price axis is price_mode auto (the default: fitted to the bars in view, as the chart does with Auto on) or manual with price_min and price_max: Auto is off, price_min is the bottom edge of the price pane and price_max the top edge, and the axis stays there. A manual window needs both ends and price_max above price_min. price_min and price_max without price_mode mean manual. With auto they are refused. width and height are the picture's size in pixels: width 800 to 1600 (default 1200), height 450 to 1000 (default 675). A wide, short picture suits a guide; a taller one shows more indicator panes. symbol, venue, kind, timeframe and layout pick the chart as in read_chart (omit them for the layout on screen). Add the indicators first with add_indicator, and the layout must have them saved: the picture shows the layout, not a draft. The answer has screenshot (the picture's id, keep it for attach_screenshot_to_guide), width, height, layout, market, applied (the exact time window from and to in UTC, first_bar, last_bar, bars), price (min, max and auto as the chart drew them), and scripts (each BullScript™ copy's state: ready or error; look at the picture and fix a script that shows error before using it). The image itself comes with the answer. Pictures are kept for 24 hours unless a guide uses them, and count toward the member's chart pictures (the same hourly and total limits as pictures they add themselves). Too many this hour is screenshot_rate; too many stored is screenshot_limit. Another picture being drawn right now is screenshot_busy: wait and retry. A picture that took too long is screenshot_timeout. Example, a 1D chart of BTC/USDT from March to May 2022, 1200 by 675, price 30000 to 50000: {"symbol": "BTC/USDT", "venue": "BINANCE", "timeframe": "1D", "from": "2022-03-01", "to": "2022-05-31", "width": 1200, "height": 675, "price_mode": "manual", "price_min": 30000, "price_max": 50000}.

Inputs#

NameTypeRequiredDescription
symbolstringOptionalTicker or pair, for example BTCUSDT or AAPL.
venuestringOptionalOptional venue, for example BINANCE, COINBASE, BITSTAMP or NASDAQ. BINANCE is Binance spot, not Binance futures.
kindstringOptionalOptional. spot or perp. Omit to open a spot market. Perpetuals are only opened when kind is perp or the venue is a futures venue.
timeframestringOptionalOne of 1H, 4H, 1D, 1W, 1M. Example: 1D.
layoutstringOptionalLayout name from list_layouts, or "Default" (the member's own chart). Omit to use the layout the member has open, or Default when no chart is open.
fromstring or numberOptionalStart of the period, as in set_visible_range: a UTC date "2022-03-01", a UTC date and time, an ISO 8601 time with an offset, or unix seconds. Send with to.
tostring or numberOptionalEnd of the period, in the same formats. A date alone means the end of that UTC day. Send with from.
barsintegerOptionalInstead of from and to: show the newest this many bars (2 to 5000).
padding_barsintegerOptionalEmpty bar widths on each side, 0 to 100. Default 1. Not with reset. Default: 1.
resetbooleanOptionaltrue shows the chart's default view: the newest 120 bars. This is also what you get when you pass none of from, to, bars and reset. Send it alone.
price_modeauto | manualOptionalauto (default): the price axis fits the bars in view. manual: Auto is off and the axis shows exactly price_min to price_max.
price_minnumberOptionalWith manual: the price at the bottom edge of the price pane. Needs price_max.
price_maxnumberOptionalWith manual: the price at the top edge of the price pane, above price_min.
widthintegerOptionalPicture width in pixels, 800 to 1600. Default 1200. Default: 1200.
heightintegerOptionalPicture height in pixels, 450 to 1000. Default 675. Default: 675.