Create strategies codes with ChatGPT for ProRealTime

Forums ProRealTime English forum General trading discussions Create strategies codes with ChatGPT for ProRealTime

Viewing 15 posts - 31 through 45 (of 63 total)
  • #215486

    TraderGlyn 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?

    I’m not a skilled coder and don’t have my own algo unfortunately.

    Bard, at least for now, appears unable to write ProRealCode even after giving it a sample of correct code to learn from. I was surprised as Bard AI is described as a complex language model capable of “machine learning”. In this respect it seems way behind ChatGPT 4 currently.
    With that said, this technology surely holds incredibly useful potential for us traders.

    1 user thanked author for this post.
    #215517

    Hi all, I am back after a long break. Chatgpt got me interested back into experimenting with strategies. It makes starting up a workflow so much more easier.

    Here’s a simple strategy I asked it to make with Nichola’s prompt(with many thanks)

    Seems to do pretty well. Alteast to help in formalising the initial strategy

    #215526

    Thank you @monochrome

    and what was your prompt to get a so nicely coded strategy please?

    #215562

    This was my initial ask –
    Code me a strategy for DAX in the 5 min timeframe. During the opening 3 hours buy when price crosses over the highest price since 1am and vice versa for sell. Profit target is 5pips and stop loss is the low of the previous bar

    I had to correct it a few times by saying for eg –
    – there is no when function, recode the dax strategy
    – this code does not work

    I think we can make the prompt better by giving it most commonly used functions and a few simple examples.

    Still testing

    this is what it gave me initially –

    #215570

    I think we can make the prompt better by giving it most commonly used functions and a few simple examples.

    Yes, that’s what I’m looking to improve, the intial prompt. That’s why we all should share our experience with wrong results and how we have resolved them with other specificitions given to ChatGPT.

    #215625

    I asked ChatGPT  “I want sell when the price is 20% above the startpoint” and listed my code and got my result. I then asked “can I improve the macd” I was given a few improvements to my code and the end result. I then asked “show me code for divergence analysis” based on one of the end results. I cleaned up the code and listed below. I’ll back test and test on demo this week.

     

    2 users thanked author for this post.
    #215899

    Anybody tried to get ChatGPT to create a Machine Learning Algo.

    #215951

    indeed I.A allows to progress the personal coding, on the other hand I am surprised that the remarks which are made to him on the errors start again the next day. it doesn’t seem to save corrections or bad elements from languages outside of PRT.

    #215952

    it doesn’t seem to save corrections or bad elements

    Let’s call your Chat – Chat No 1.

    ChatGPT saves the corrections and bad elements you advised about and got sorted, but only remembers within Chat No 1.

    If you start another Chat – Chat No 2, then there is no link across / memory from Chat No 1.

    1 user thanked author for this post.
    #216285

    I made an algo today, approximately 6 months after making my first algo with ChatGPT. I used the prompts provided here in the forum thread, but it’s still not really making plug-and-playable code for ProRealTime.
    The first issue with ChatGPT was that it insisted to use underscores in the variable names, which is not accepted by ProBuilder language. I think it’s an easy instruction to add – but I have also noticed that ChatGPT seems to have issue when providing too many instructions.

    Here’s the video of me making it and the full code it generated.
    https://youtu.be/YciwTN4ZquU

    Here’s the full code

     

    1 user thanked author for this post.
    #216365

    I actually see now that the initial prompt had instructions not to have underscores in the variable names. It really proves that ChatGPT still have issues handling too many instructions in the same prompt.

    1 user thanked author for this post.
    #216381

    Thank you Nicholas for this post, it’s just incredible and all informations shared here are just real gold mine. I’m starting my own test to improve my own PRC strategies ! I will probably share my feedback in future.

    2 users thanked author for this post.
    #217304
    AMQ

    Hi all!

    I would like to convert code for trailing stop, based on parameters, in code based on action price. To get that, I used de first prompt and then:

     

    “trailing stop” is a stop loss that is moving near the price, based in rules included in the code, in order to exit the operation if the price turns back against the position. Answer “YES” if you can understand the meaning of “trailing stop”
    ChatGPT

    YES

     

    User
    I will paste “trailing stop” code and i will ask you to write probuilder code based in the minimum and maximum of prior candlesticks in timeframe 5 min. Answer “YES” if you are ready me to paste the “trailing stop” code
    ChatGPT

    YES, you can go ahead and paste the “trailing stop” code.

    The result is different to the objetive, so i would like to ask you if you suggest a better prompt.

    Trailing stop Code is the next one for 2 min TF:

    // — 0. Variables

    pp = (positionperf*100)

    // — 1. Trailing stop

    once enablets = 1 // activar trailing stop
    // trailing stop

    if shortonmarket then
    ts1= 0.5 // es mayor que este porcentaje, entonces utiliza trailingstop ts1
    switch= 0.55 // es mayor que este porcentaje, entonces utiliza trailingstop ts2
    ts2= 0.35
    switch2= 0.7 // es mayor que este porcentaje, entonces utiliza trailingstop ts3
    ts3= 0.3
    endif

    if longonmarket then
    ts1= 0.48//0.55//0.48 // es mayor que este porcentaje, entonces utiliza trailingstop ts1
    switch=1.03//1.05//0.4 // es mayor que este porcentaje, entonces utiliza trailingstop ts2
    ts2=0.35//0.85
    switch2= 1.3//1.75 // es mayor que este porcentaje, entonces utiliza trailingstop ts3
    ts3=0.25//0.2
    endif

    pp = (positionperf*100)
    if enablets then

    trailingstop1 = (tradeprice(1)/100)*ts1
    trailingstop2 = (tradeprice(1)/100)*ts2
    trailingstop3 = (tradeprice(1)/100)*ts3

    if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) then
    maxprice1=0
    minprice1=close
    priceexit1=0

    maxprice2=0
    minprice2=close
    priceexit2=0

    maxprice3=0
    minprice3=close
    priceexit3=0

    a1 = 0
    a2 = 0
    a3 = 0

    pp=0

    endif

    if onmarket then
    if pp >= ts1 then
    a1=1
    endif
    if pp >= switch then
    a2=1
    endif
    if pp >= switch2 then
    a3=1
    endif
    endif

    // setup long

    if longonmarket then
    maxprice1=max(maxprice1,close)
    maxprice2=max(maxprice2,high)
    maxprice3=max(maxprice3,high)
    if a1 then
    if maxprice1-tradeprice(1)>=(trailingstop1)*pointsize then
    priceexit1=maxprice1-(trailingstop1)*pointsize
    endif
    endif
    if a2 then
    if maxprice2-tradeprice(1)>=(trailingstop2)*pointsize then
    priceexit2=maxprice2-(trailingstop2)*pointsize
    endif
    endif
    if a3 then
    if maxprice3-tradeprice(1)>=(trailingstop3)*pointsize then
    priceexit3=maxprice3-(trailingstop3)*pointsize
    endif
    endif
    endif

    // setup short

    if shortonmarket then
    minprice1=min(minprice1,close)
    minprice2=min(minprice2,low)
    minprice3=min(minprice3,low)
    if a1 then
    if tradeprice(1)-minprice1>=(trailingstop1)*pointsize then
    priceexit1=minprice1+(trailingstop1)*pointsize
    endif
    endif
    if a2 then
    if tradeprice(1)-minprice2>=(trailingstop2)*pointsize then
    priceexit2=minprice2+(trailingstop2)*pointsize
    endif
    endif
    if a3 then
    if tradeprice(1)-minprice3>=(trailingstop3)*pointsize then
    priceexit3=minprice3+(trailingstop3)*pointsize
    endif
    endif
    endif

    // exit long

    if longonmarket and priceexit1>0 then
    sell at priceexit1 stop
    endif
    if longonmarket and priceexit2>0 then
    sell at priceexit2 stop
    endif
    if longonmarket and priceexit3>0 then
    sell at priceexit3 stop
    endif

    // exit short

    if shortonmarket and priceexit1>0 then
    exitshort at priceexit1 stop
    endif
    if shortonmarket and priceexit2>0 then
    exitshort at priceexit2 stop
    endif
    if shortonmarket and priceexit3>0 then
    exitshort at priceexit3 stop
    endif
    endif

    Many thanks.

    Alfonso

     

    #217326

    What part of the above code (if any?) was provided by ChatGPT?

    If you use the Insert PRT Code button (far right top line above each new message – blue button) then Line Numbers will show in posted code … makes it easier for us all. 🙂

     

    #217328
    AMQ

    Ok, thanks and sorry: Next post I Will use It as said.

    This code works in Backtest and real systems.

    What I would need is Code for trailing stop based on price action instead of optimizable variables, so I asked GPT to write Code for that. I am afraid that the prompt used is not working well, so I need more ideas to write the Code based on Price Action.

     

    Thanks a lot.

Viewing 15 posts - 31 through 45 (of 63 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login