Skip to content

Quick-tip 96 | Can ChatGPT write TradeStation EasyLanguage programs?

Quick-tip96

ChatGPT, developed by OpenAI, is a highly advanced and versatile conversational AI, capable of understanding and generating human-like text for a wide range of applications. You may have already used it to write a list, or summarize an issue  simply by typing the request into a text box. I just asked it to “Describe ChatGPT” and it came up with the description that I have included in the orange text box below.

But can it write simple TradeStation EasyLanguage code? 

I asked it three questions and received the scripts described in the video. The questions were:

  1. Write TradeStation EasyLanguage indicator using a Vector object (NOT an array) to calculate and plot the CCI on a chart
  2. Write TradeStation EasyLanguage Show me study to show significant turning points in price based on momentum and volume
  3. Write TradeStation EasyLanguage Show me study to show significant turning points in price based on momentum, stochastics and volume

“Describe ChatGPT”

ChatGPT, developed by OpenAI, is a state-of-the-art conversational AI model based on the GPT-4 architecture. It is designed to understand and generate human-like text based on the input it receives. Here’s a detailed description of ChatGPT:

Core Features

  1. Language Understanding and Generation:

    • Comprehension: ChatGPT can understand and interpret a wide range of topics, from simple questions to complex discussions.
    • Generation: It can generate coherent and contextually relevant responses, making it suitable for conversation, content creation, and more.
  2. Versatility:

    • Conversational Abilities: It can engage in open-ended conversations, providing detailed responses, asking clarifying questions, and maintaining the context over multiple turns.
    • Task-Specific Applications: It can assist with specific tasks such as answering queries, providing recommendations, drafting emails, writing essays, and even coding.
  3. Knowledge Base:

    • Training Data: Trained on diverse datasets, it possesses a broad knowledge base, covering a wide array of subjects, including science, history, culture, and current events up until its knowledge cutoff in October 2023.
    • Knowledge Updates: While it doesn’t have real-time learning capabilities, it can be periodically updated with new data to improve its responses.

Technical Aspects

  1. Architecture:

    • GPT-4 Model: ChatGPT is built on the GPT-4 architecture, which stands for “Generative Pre-trained Transformer 4.” This model leverages advanced machine learning techniques to process and generate text.
  2. Training Methodology:

    • Supervised and Reinforcement Learning: The model is trained using a combination of supervised learning, where it learns from a vast corpus of text data, and reinforcement learning, where it is fine-tuned based on user interactions and feedback to improve its performance.
  3. Safety and Ethics:

    • Content Moderation: ChatGPT is equipped with mechanisms to avoid generating harmful or inappropriate content. It adheres to ethical guidelines to minimize biases and prevent misuse.
    • User Privacy: OpenAI ensures user interactions with ChatGPT are handled with privacy and confidentiality in mind.

Practical Applications

  1. Customer Support: Provides automated responses to customer queries, improving efficiency and response times.
  2. Educational Tools: Assists students and educators by explaining concepts, providing information, and even tutoring on various subjects.
  3. Content Creation: Helps writers, marketers, and creators by generating ideas, drafting content, and editing text.
  4. Personal Assistance: Functions as a virtual assistant, helping with scheduling, reminders, and basic information retrieval.

Limitations

  1. Context Retention: While it can maintain context within a conversation, it may struggle with very long or complex dialogues.
  2. Current Events: Its knowledge is up to date only until October 2023, so it might not be aware of more recent events or developments.
  3. Ambiguity Handling: May sometimes provide vague or overly general answers if the input is unclear or ambiguous.

In summary, ChatGPT is a highly advanced and versatile conversational AI, capable of understanding and generating human-like text for a wide range of applications, while being mindful of ethical and safety considerations.

The results were surprisingly good with excellent comments and descriptions of variables and the programs function.

I did note the following:

  1. I had to re-run the CCI program question several times before the calculation of the CCI was correct for historic bars (when compared to the standard Commodity Channel Indicator indicator to 2 decimal places). Even after this there remained significant discrepancies between the ChatGPT calculated value and the actual value, particularly for real time bars. This was caused by new elements being continually added to the vector for real time time ticks. I corrected this by making sure that a new element was only added to the vector on the last tick of the bar. For ticks occuring within the bar the zero element of the vector is updated.
  2. ChatGPT occasionally used syntax that didn’t exist in TradeStation EasyLanguage. It was relatively straightforward to replace it with the correct syntax. For example in the _CCI_ChatGPT indicator, it used CCIVector.remove_front which I replaced with CCIVector.Erase( 0 )
  3. ChatGPT sometimes used reserved words as variable names. For example in _CCI_ChatGPT it used i as a counter. i is actually a shortcut notation that returns the Open Interest of a bar, the number of contracts outstanding at the close of the bar.
  4. ChatGPT could easily misinterpret what you are asking for.

I would suggest that ChatGPT could be useful in the following:

  1. Creating simple programs
  2. Learning EasyLanguage, especially when the tool makes mistakes and the user needs to work out what they are. It is also useful to quickly work out how something might be programmed (or course ChatGPT might be incorrect).
  3. Asking the same questions repeatedly can show how tasks can be programmed differently.
  4. Providing well formatted programs complete with comments and textual explanations.
One of the turning point programs and the CCI applied to a 60 minute AMZN chart
One of the turning point programs and the CCI applied to a 60 minute AMZN chart

Video explanation of quick-tip 96

Quick-tip 96 TradeStation EasyLanguage code for Gold Pass members

If you are a Gold Pass member you can download the programs generated by ChatGPT below, please make sure that you are logged in with your Gold Pass user name and password.

This content is for members only.

THE TRADING APPS, INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES.

TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.

ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, TRADING APPS, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.