For example: -> Add symbol (+) -> search bar -> type -> AAPL/GOOG or ((AAPL*2) + (GOOG*3)) / BTCUSD or ... -> press Enter -> the chart will appear and is added to your watchlist
Sometimes you want a script to do something ONLY when the chart is on a particular ticker
For example, you want a draw line at the latest high, only when 'AAPL' is selected for your chart: (if I would use following logic, I would code this differently, this is just for making a simple example)
The same with '((AAPL*2) + (GOOG*3)) / BTCUSD' The syminfo.ticker is actually 'AAPL*2+BATS:GOOG*3)/BITSTAMP:BTCUSD' 😃
->
Cheers!
Ghi chú
You can create large combinations, for example: 'MKRUSD+AAVEUSD+CVXUSD+UNIUSD+COMPUSD+INSTUSDT+BALUSD+YFIUSD+BNTUSD+LQTYUSD' (max 10 during testing) To make it easy to copy such a string, you can make an alert:
strAAPL_GOOG='AAPL*2+BATS:GOOG*3)/BITSTAMP:BTCUSD'// we know this worked previously hi_AAPL_GOOG=request.security(strAAPL_GOOG,'',high) ifbarstate.islast line.new(bar_index,hi_AAPL_GOOG,bar_index+1,hi_AAPL_GOOG,extend=extend.both,color=color.blue)
This gives an error -> symbol resolve error
if we use what is visible at the top left -> no issue
This idea/script is part of a collection of educational idea's/scripts If you want to return to the open source INDEX page, click here -> Education: INDEX
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.