Hi!
Okay, so what I'm trying to do is to modify an indicator. This has been done quite successfully, just using text editors. However, I cannot seem to achieve quite what I want, at a closer look.
1. How do I obtain the market price at which the indicator actually triggered? (also historically) I.e. what price made the indicator trigger?
I have tried with bid.close[period] and source.close[period] and median and so on. Nothing actually saves the entry value, even if I try to only obtain the value at the trigger (it draws arrows up/down for buy/sell for a period). It just takes the candle and uses the close value, not where it actually triggered. Only for the most current period it works as intended, but at update the graph it takes the close price instead. I also tried instance.bid[instance.bid:size() - 1] (from documentation), but that even gave me an error saying it doesn't return a number.
2. How do I time stamp the entry/trigger of the indicator with hour:min:second resolution?
All I have achieved is time stamps with resolution of what the actual time frame I'm looking in. So if my indicator triggered at 11:13:21, it will in 1 min show 11:13:00, 5 min 11:15:00, etc..