bettyjeanbell
New member
Hi, folks. Thanks so much for taking time to consider my questions.
I'm working on completing my first, entirely from scratch indicator and it works great! It's something I've needed for a long time. I'm now adding some features that would make it a LOT easier to use and am running into some issues I could use your help with.
1) Can thinkscript indicators automatically pull entry price?
My indicator automatically draws stop loss and profit taking lines above and below the entry price of my trade. Currently, I have to manually enter my entry price into the indicator at the start of each trade. It's fine, but takes valuable time.
Is there a way to code an indicator to automatically pull the entry price of the trade I'm currently in? If so, could you please share an example of that code with me? Thank you so, so much.
2) Having trouble getting alerts based on price action to work.
A bonus feature is that I wanted to trigger alerts to sound when price action crosses these percentage lines, live in real time. Currently, I can get the alerts to sound but not based on the price action. Here's the code related to the alerts... would love your help getting this to work. Thank you endlessly for any recommendations or suggestions.
input PriceType = PriceType.LAST;
def LastPrice = close(priceType = priceType);
Alert(LastPrice <= OpeningStop, "Stopped Out, Opening Stop", Alert.Bar, Sound.Bell);
Alert(LastPrice >= PT10, "At 10%, move stop up to BE", Alert.Bar, Sound.Ring);
Thanks so much for your help and expertise.
I'm working on completing my first, entirely from scratch indicator and it works great! It's something I've needed for a long time. I'm now adding some features that would make it a LOT easier to use and am running into some issues I could use your help with.
1) Can thinkscript indicators automatically pull entry price?
My indicator automatically draws stop loss and profit taking lines above and below the entry price of my trade. Currently, I have to manually enter my entry price into the indicator at the start of each trade. It's fine, but takes valuable time.
Is there a way to code an indicator to automatically pull the entry price of the trade I'm currently in? If so, could you please share an example of that code with me? Thank you so, so much.
2) Having trouble getting alerts based on price action to work.
A bonus feature is that I wanted to trigger alerts to sound when price action crosses these percentage lines, live in real time. Currently, I can get the alerts to sound but not based on the price action. Here's the code related to the alerts... would love your help getting this to work. Thank you endlessly for any recommendations or suggestions.
input PriceType = PriceType.LAST;
def LastPrice = close(priceType = priceType);
Alert(LastPrice <= OpeningStop, "Stopped Out, Opening Stop", Alert.Bar, Sound.Bell);
Alert(LastPrice >= PT10, "At 10%, move stop up to BE", Alert.Bar, Sound.Ring);
Thanks so much for your help and expertise.