I defined a request.security function
RequestSecurity(_tic, _tf, _exp) =>
request.security(_tic,_tf,_exp[barstate.isconfirmed?0:1])[barstate.isconfirmed?1:0]
used it several times to achive a 5min breakout (to search then entries in lower timeframe) like
htf5YH_longtrend = RequestSecurity(syminfo.tickerid,”5″,YH_longtrend)
or
htfhigh = RequestSecurity(syminfo.tickerid,”5″,high)
in the end i have my strategyblock where i count RRs (= RtoR) and want to sum up the RtoR value over several stocks to spread risk, i use it again like
TSLAprofit = RequestSecurity(ticker.modify(‘NASDAQ:TSLA’, session = session.extended),timeframe.period,RtoR)
But this line only works when I am in the NASDAQ:TSLA window, not when i change the ticker.
Any idea why i can request higher TF data but then not data from a different ticker?
Got the hint it could to put
RequestSecurity(_tic, _tf, _exp) =>
request.security(_tic,_tf,_exp[barstate.isconfirmed?0:1])[barstate.isconfirmed?1:0]
inside the
TSLAprofit = RequestSecurity(ticker.modify(‘NASDAQ:TSLA’, session = session.extended),timeframe.period,RtoR)
but don’t know how. Any idea?
Matthias Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.