Search found 96 matches

Go to advanced search

by Steve Burman
Fri Oct 20, 2023 9:34 pm
Forum: Pine Script Q&A
Topic: Resetting stop loss indicator
Replies: 6
Views: 7993
 
Jump to post

Re: Resetting stop loss indicator

Sorry for the delay in replying. It seems you are missing (or have changed) the part of Matt's code where he resets the trailing stop and draws it on the chart as follows: // If long stop is hit, reset trail stop if trailPrice != 0.0 and low <= trailPrice and trailType == "Long" trailPrice := na // ...
by Steve Burman
Tue Oct 17, 2023 3:46 am
Forum: Pine Script Q&A
Topic: Resetting stop loss indicator
Replies: 6
Views: 7993
 
Jump to post

Re: Resetting stop loss indicator

A few questions: 1. Are you getting trades showing on the chart each time? 2. Is the trailing stop drawing on the chart at least initially? 3. Are you resetting the value of trailPrice to 0 each time the trade is closed and recreating the value for each candle update? 4. Have you watched Matt's vide...
by Steve Burman
Tue Oct 17, 2023 3:36 am
Forum: Pine Script Q&A
Topic: Syntax error at input '['
Replies: 1
Views: 2310
 
Jump to post

Re: Syntax error at input '['

I would suggest the error is in this line

headers = ['X-MBX-APIKEY': api_key]

You may need to get in contact with the script owner to understand what this does and how to fix this.

Also remove [0] from lines such as buy_volume := buy_volume + bid[0] which should be buy_volume := buy_volume + bid
by Steve Burman
Tue Oct 17, 2023 3:21 am
Forum: Pine Script Q&A
Topic: how to use timeframe.period
Replies: 1
Views: 1893
 
Jump to post

Re: how to use timeframe.period

You can do something like this: float TF = switch timeframe.period "5" => 1 "60" => 15 "D" => 60 => 30 // this is the default if none of the above options are a match or whatever values you like. It compares timeframe.period to the 3 options (or as many as you want) "5", "60" and "D" and whichever o...
by Steve Burman
Wed Oct 04, 2023 11:13 pm
Forum: Pine Script Q&A
Topic: Converting v2 to v5
Replies: 2
Views: 2036
 
Jump to post

Re: Converting v2 to v5

Hi Vanise,

Unfortunately this cannot be easily converted or in fact converted at all. There is a missing variable n which is not defined so it seems a line of code is missing. I even tried using ChatGPT to convert it but it also failed. I strongly suggest you try contacting the author of the script.
by Steve Burman
Wed Oct 04, 2023 10:56 pm
Forum: Pine Script Q&A
Topic: a good Engulfing Candle script need to be converted
Replies: 2
Views: 2029
 
Jump to post

Re: a good Engulfing Candle script need to be converted

I had a go doing this but it is quite complicated and failed. I suggest you contact the author and ask them to convert it.
by Steve Burman
Tue Sep 26, 2023 11:47 pm
Forum: Pine Script Q&A
Topic: Does this exist?
Replies: 1
Views: 666
 
Jump to post

Re: Does this exist?

To set the SL to break even simply update the stop value to the entry price of the trade when the RR ratio is met. e.g. if you had an strategy.exit statement as strategy.exit(id="Long Exit", from_entry="Long", limit=t_target, stop=t_stop) then you save the entry price in a variable when your strateg...
by Steve Burman
Wed Sep 20, 2023 3:26 am
Forum: Pine Script Q&A
Topic: Alert on watchlist
Replies: 1
Views: 734
 
Jump to post

Re: Alert on watchlist

Unfortunately, you would need to have a each stock/forex pair/crypto in your watchlist and each one would have to have an alert to notify you
by Steve Burman
Wed Sep 20, 2023 3:24 am
Forum: Pine Script Q&A
Topic: Question: syntax for shorting
Replies: 1
Views: 708
 
Jump to post

Re: Question: syntax for shorting

The syntax is similar to entering and closing a long position.

strategy.entry(id = "Short", direction = strategy.short, qty = 1)

strategy.exit(id = "Exit", from_entry = "Short", profit = 10, loss = 5)
by Steve Burman
Wed Sep 20, 2023 3:18 am
Forum: Pine Script Q&A
Topic: how to open a new chart in a new tab in trading view desktop app
Replies: 1
Views: 789
 
Jump to post

Re: how to open a new chart in a new tab in trading view desktop app

I have not heard of anything like this being possible. Sorry

If anyone else has come across this then please post it

Go to advanced search