The resource loading... loading...

When FMZ encounters ChatGPT, an attempt to use AI to assist in learning quantitative trading

Author: FMZ~Lydia, Created: 2023-02-08 11:54:20, Updated: 2024-11-29 18:55:06

img

When FMZ encounters ChatGPT, an attempt to use AI to assist in learning quantitative trading

ChatGPT

ChatGPT has been very popular recently. There are various videos applied to real-world scenarios on the Internet. Let me introduce what ChatGPT is briefly. ChatGPT is a language model developed by OpenAI. Unlike previous AI, ChatGPT has very strong language understanding ability. There are many videos about the introduction, registration and use of ChatGPT on the network. I will not repeat them here.

When FMZ encounters ChatGPT

In the field of quantitative trading learning, beginners have always been very difficult at the entry stage. Because most beginners are based on 0, they lack both grammatical knowledge and thinking logic for code, so they will feel it is very difficult to learn.

OK, the next article is not written by me. Let’s show some appetizers.

part1 When FMZ encounters ChatGPT, an attempt to use AI to assist in learning quantitative trading

As a beginner, I have been looking for effective ways to learn quantitative trading. After searching online, I found FMZ and ChatGPT. So I decided to try to use them to deepen my understanding of quantitative trading.

First, I learned how to use PINE script to write a trading strategy on FMZ. On this platform, I found templates for various strategies and tested their effects by adjusting parameters. In addition, I also learned how to use the backtesting function to evaluate the returns of the strategy.

Next, I use ChatGPT to get more help. On this platform, I found an AI assistant named Assistant, who can answer my various questions. Through communicating with Assistant, I learned a lot of useful knowledge and got many valuable suggestions.

In the process of using FMZ and ChatGPT, I gained a lot. Not only learned how to write trading strategies, but also gained more knowledge about quantitative trading. I believe that as I continue to learn and practice,

part2 I will be able to further improve my trading skills and achieve better returns in the future.

Although using FMZ and ChatGPT can get a lot of help, I also realize that quantitative trading is a continuous learning process. I still have a lot to learn, and I will continue to work hard to improve myself.

In the end, I hope my attempt can help other beginners. If you also want to learn quantitative trading, try FMZ and ChatGPT platforms, which may become powerful assistants for you to learn.

part3 Of course, quantitative trading is not an easy task. It requires continuous learning and practice to improve skills. Therefore, I also suggest that you participate in various training courses and community activities, exchange trading experience with professionals, and always staycurious and inquisitive.

In addition, it is also very important to pay attention to risk management. There are many uncertain factors in quantitative trading, so we must set a reasonable stop-loss strategy and select the trading variety and trading period carefully.

part4 To sum up, I believe using FMZ and ChatGPT platforms to learn quantitative trading is a good choice. They provide us with rich learning resources and assistance, so that we can grasp knowledge and practice easily. However, we should also remember that learning quantitative trading is a continuous process, and we need to make continuous efforts to achieve greater success in this field.

Ok, I’ll start writing again, you can believe it! The above part1 ~ part4 are written by ChatGPT. Let me show some evidence:

img

When FMZ encounters ChatGPT, an attempt to use AI to assist in learning quantitative trading

As a beginner, I have been looking for effective ways to learn quantitative trading. After searching online, I found FMZ and ChatGPT. So I decided to try to use them to deepen my understanding of quantitative trading.

First, I learned how to use PINE script to write a trading strategy on FMZ. On this platform, I found templates for various strategies and tested their effects by adjusting parameters. In addition, I also learned how to use the backtesting function to evaluate the returns of the strategy.

Next, I use ChatGPT to get more help. On this platform, I found an AI assistant named Assistant, who can answer my various questions. Through communicating with Assistant, I learned a lot of useful knowledge and got many valuable suggestions.

In the process of using FMZ and ChatGPT, I gained a lot. Not only learned how to write trading strategies, but also gained more knowledge about quantitative trading. I believe that as I continue to learn and practice,

Go on:

img

I will be able to further improve my trading skills and achieve better returns in the future.

Although using FMZ and ChatGPT can get a lot of help, I also realize that quantitative trading is a continuous learning process. I still have a lot to learn, and I will continue to work hard to improve myself.

In the end, I hope my attempt can help other beginners. If you also want to learn quantitative trading, try FMZ and ChatGPT platforms, which may become powerful assistants for you to learn.

Go on:

img

Of course, quantitative trading is not an easy task. It requires continuous learning and practice to improve skills. Therefore, I also suggest that you participate in various training courses and community activities, exchange trading experience with professionals, and always stay curious and inquisitive.

In addition, it is also very important to pay attention to risk management. There are many uncertain factors in quantitative trading, so we must set a reasonable stop-loss strategy and select the trading variety and trading period carefully.

To sum up, I believe using FMZ and ChatGPT platforms to learn quantitative trading is a good choice.

Let’s start the topic again.

Let AI write a strategy for me

If I am an introductory learner of the PINE language on the FMZ platform with 0 basics, I can put forward a simple requirement for ChatGPT to see if AI can help me write code:

Propose requirements:

Can you use the PINE script to write a double EMA strategy for me? The moving average index of different periods is that the up cross is to open long positions, the down cross is to open short positions, and the stop loss is 100 points. And give me the complete PINE script strategy. Use version control code://@ version=4

img

Certainly. This is an example of using PINE script to write a double EMA strategy, starting with version control code://@ version=4

img

In this code, we first set two parameters that can be adjusted: long-term average period and short-term average period. Then, we calculate the two moving averages and use the statement to determine whether there is an up cross or a down cross. If an up cross occurs, go long; if a down cross occurs, go short. Finally, we set a stop loss point. If the price falls below the stop loss point, the position will be closed.

Note: This is only an example, and it does not guarantee that the strategy will yield good returns. Risk should be carefully considered when using any trading strategy.

// @version=4
strategy("double EMA strategy", overlay=true)

longTerm = input(title="long-term average period", type=input.integer, defval=200)
shortTerm = input(title="short-term average period", type=input.integer, defval=50)
stopLoss = input(title="stop loss point", type=input.integer, defval=100)

longMA = sma(close, longTerm)
shortMA = sma(close, shortTerm)

if (shortMA > longMA)
    strategy.entry("go long", strategy.long)
if (shortMA < longMA)
    strategy.entry("go short", strategy.short)

strategy.exit("stop loss", "go long", stop=strategy.position_avg_price - stopLoss)
strategy.exit("stop loss", "go short", stop=strategy.position_avg_price + stopLoss)

It wrote the code out. Let me run it on the FMZ platform backtest system!

img img

PINE script is running!

Next, let ChatGPT help us explain the strategy, which can also help us learn about quantitative trading.

Ask the question:

strategy("test", overlay = true)

varip a = na
varip highPrice = na
varip isTrade = false 
varip offset = 30

if not barstate.ishistory and not isTrade
    strategy.entry("test 1", strategy.long, 1)
    strategy.exit("exit 1", "test 1", 1, trail_price=close+offset, trail_offset=offset)
    a := close + offset
    runtime.log("The price per point is:", syminfo.mintick, ", current close:", close)
    isTrade := true 

if close > a and not barstate.ishistory
    highPrice := na(highPrice) ? close : highPrice
    highPrice := close > highPrice ? close : highPrice

plot(a, "trail_price trigger line")    
plot(strategy.position_size>0 ? highPrice : na, "current highest price")
plot(strategy.position_size>0 ? highPrice-syminfo.mintick*offset : na, "moving stop loss trigger line")

Can you explain the detailed logic of this script?

Screenshots:

img img img

It can get the meaning of this script and summarize it. I am wondering if there is a quantitative trading researcher answering my question behind this page…

Imperfections

Of course, ChatGPT is not perfect yet. For example, when communicating with it in Chinese, it often breaks off. It needs to continue with the dialogue of “continue to speak”. For some questions that it doesn’t know very well, it will talk nonsense with you. We need to combine search engines to determine the answers given, and we can’t blindly believe it. However, ChatGPT is still very helpful for quantitative trading learning on FMZ. It can help us understand the code that is difficult to understand. At least it can give us some hints and inspiration, so that we know what to learn. It can also help us write some simple code prototypes, give some basic solutions and code implementation. There should be more advanced methods. We can continue to explore in the future. We hope that ChatGPT will become more and more powerful and help more quantitative trading beginners get started easily.

I hope that there will no longer be “from getting started to giving up” in the study of quantitative trading in the future!


Related

More