Create strategies codes with ChatGPT for ProRealTime
Forums › ProRealTime English forum › General trading discussions › Create strategies codes with ChatGPT for ProRealTime
- This topic has 76 replies, 18 voices, and was last updated 3 months ago by GraHal.
-
-
05/25/2023 at 9:53 AM #215156
I thought that it was the idea to : together teach ChatGPT to work with Probuilder. This starts with the things you taught it, to be available to me. But it isn’t ?
Shouldn’t this have worked ?
PS: code a strategy that: buy at market on new downtrend detection of ALPHATREND indicator, after 3 successive green bars
ChatGPT (4)
Here’s a basic example of how you might write this strategy in ProRealTime. However, it should be noted that the AlphaTrend Indicator isn’t a built-in indicator in the ProRealTime platform (as of my last training data cut-off in September 2021). You might have a custom code for AlphaTrend indicator, or it might have been added after my last update.
Here’s the code considering you have a custom function called “AlphaTrend” which returns 1 for uptrend and -1 for downtrend:
123456789101112131415161718192021222324252627DEFPARAM FlatAfter = 235959 // Stops trading before midnightDEFPARAM CumulateOrders = False // Allows multiple simultaneous positions in the same direction// Define the AlphaTrend function (replace this with your actual AlphaTrend function)// AlphaTrend() = ...// Count consecutive green barsGreenBars = 0FOR i = 1 TO 3IF close[i] > open[i]GreenBars = GreenBars + 1ELSEBREAKENDIFNEXT// Buy conditionIF AlphaTrend() = -1 AND GreenBars = 3BUY 1 CONTRACT AT MARKETENDIF// Exit conditions// You should define your exit conditions, whether it's based on a stop loss, take profit, time exit, or any other criteria.// As an example, a simple exit on AlphaTrend uptrend:IF AlphaTrend() = 1 THENSELL AT MARKETENDIFPlease replace the
AlphaTrend()
function with the correct code for the AlphaTrend indicator you have.Please note this is a simple strategy and does not include comprehensive risk management, like a stop-loss or take-profit level. Always backtest your strategies before trading live.
Again, I would like it to work.
Never mind the attachment.
05/25/2023 at 10:09 AM #215159I just used the prompt from the first post by Nicolas with the free version Chat GPT 3.5 and then used my own prompt in my msg above and it wrote the code just like that with comments and description.
I’m not an expert but if there was a way to send the prorealtime user manual and instruction set to chatgpt, maybe the results would be more accurate.
05/25/2023 at 12:51 PM #215160The code you got seems very correct!
However, you can see that it tries to create a function, something that does not exist yet in PRT (under preparation).
So ChatGPT considers that a function in PRT secretes: FunctionName() and this is where we need to stop it and start it again, adding new information in the general prompt I gave at the beginning of the topic. The idea is to create <all together> a global prompt by adding the new information to it so that it doesn’t make this kind of error anymore.
I hope I was clearer this time 🙂05/25/2023 at 12:53 PM #215161I’m not an expert but if there was a way to send the prorealtime user manual and instruction set to chatgpt, maybe the results would be more accurate.
In my opinion, version 4 is sufficient without having to explain everything to him again, which would be a lot of work.
I have already tried to re-explain some instructions to him (which he was already using correctly) and the result was bad.
So I consider that the best we can do is to fill in his gaps by adding all the possible info in the general prompt I shared at the beginning of the topic.1 user thanked author for this post.
05/25/2023 at 12:54 PM #21516205/25/2023 at 12:56 PM #215163Yes I gave it to him in my own session! Chat sessions are private and you don’t learn ChatGPT through chat! Imagine if someone told him that Michael Jackson was an astronaut, millions of users would be affected by this false information! It’s Bad and Dangerous!
05/25/2023 at 1:05 PM #215165I have already tried to re-explain some instructions to him (which he was already using correctly) and the result was bad.
FYI : I am using it (v3 !) for the past week on two other languages, say in order to convert the one language the other. I know both languages very well.
The commands I give it are the most complex I can think of and not a single answer was wrong. But “worse” : it comes up with solutions I can’t think of myself.I am sure it is all about the knowledge of the programming language and I can’t think of anything else than that the thing knows the full language description of the languages of concern. In that regard, handing it the manual – as per @pableitor’s idea – is the idea I had myself too. But how to hand that ? For starters it doesn’t want to read behind internet links.
Plus I still can’t prove that it explicitly learns. Instead it always comes up with it’s most actual knowledge of September 2021.They key is in the fashion of asking the questions. I think I became more polite because of this. Hahaha.
05/25/2023 at 1:08 PM #215166Yes I gave it to him in my own session! Chat sessions are private and you don’t learn ChatGPT through chat! Imagine if someone told him that Michael Jackson was an astronaut, millions of users would be affected by this false information! It’s Bad and Dangerous!
Aha, so now we agree. And of course !!
But then again : I thought it was your idea to – as a community – teach ChatGPT together how to deal with the PRT language ?!? … ok, misunderstanding then.
And Yes, what I teach it privately is remembered.05/25/2023 at 1:54 PM #21516805/25/2023 at 2:42 PM #215174And Yes, what I teach it privately is remembered.
You quoted ChatGPT as saying below so how can what you teach it be remembered?
Only by including / sending / referring to a set of instructions each time?
GPT-4 :
As an AI model, I don’t have the ability to remember specific interactions or instructions from previous conversations. Each conversation with me doesn’t have a memory of past sessions. I don’t store personal data from the questions you ask me unless explicitly provided in the course of our conversation. As soon as the conversation ends, I forget it.
So if your colleagues gave instructions to me in a different session or version, I won’t be able to recall or refer to those instructions in our current conversation. This is part of OpenAI’s commitment to privacy and data security.
If you need to follow up on a previous topic or set of instructions, you would need to provide the relevant information again in our current conversation. I’m here to help answer questions and provide information based on the data I was trained on up until September 2021.
05/25/2023 at 4:51 PM #215177Per session, it does. A session is to be regarded as a chat. With a new chat (you can create as many as you like) it won’t know about the other chats. So would I refer to an other chat, it says it can’t do that.
Now knowing this, read the text you quoted (I quoted) again. :-). I suppose it will be clear then ?
1 user thanked author for this post.
05/25/2023 at 4:56 PM #21517805/30/2023 at 12:39 PM #215435Thanks, very excited to see this thread, it was just what I’ve been waiting and hoping for.
Bard.google.com is Google’s version of AI and free for all to use. However, when asked it claims to know probuilder language but the results appear incorrect and incomplete
1 user thanked author for this post.
05/30/2023 at 12:44 PM #215438TraderGlyn it be good to start a new Topic for Bard.google.com coded Algo’s etc?
Have you got an Algo you can post (in a new Topic), it be very interesting to see the results from google AI?
05/30/2023 at 12:48 PM #215440 -
AuthorPosts
Find exclusive trading pro-tools on