ChatGPT-4和AI-Agent:构建交易策略的指数法。

477 阅读5分钟

人工智能是新的电力。就像电力在大约100年前改变了许多行业一样,人工智能现在也会这样做。

image.png 进入2023年已经有五个月了,但ChatGPT-3的推出似乎只是昨天的事。欢迎来到光辉的指数宇宙。这不是跟随某人的Twitter提示,让我们的生活被规划出来,无论我们是否喜欢。长路提供了潜力,而短路则将我们带向平庸,就像生活中的其他一切。

在就业市场上,人工智能并不准备取代你;相反,那些善于运用人工智能为自己谋利的人可能会兴旺,甚至可能超过你。使用定制的人工智能,并对特定的应用领域有透彻的了解,这才是人工智能的真正前景所在。这种特定的人工智能有可能完全改变所有行业。一切都将发展成一个指数级的循环,转弯速度更快。

一定有许多可以使用指数圆的实例。作为一个简单的例子,我们在这篇文章中任命ChatGPT4为SmartLever的CEO,目的是建议每周采取行动,帮助我们扩大社区。ChatGPT要求我们从确定我们最成功的帖子开始,用新鲜的内容更新它。这篇帖子就是结果。

在这篇文章中,我们用ChatGPT-3建立了一个可以用SmartBots的自动交易系统。因此,我们不使用Bing,而是利用AIAgents,这是一个正在革新人工智能的最新想法,这是一个比我们上次使用的ChatGPT-4强大10倍的AI。

的查询,代理:

在AI剑桥的爆炸中,AI代理是一个热点问题。正在迅速扩展的几个库是BabyAGIAutoGPT

人工智能(AI)代理是计算机程序或系统,它们根据其程序设计和所获得的数据独立进行操作、得出结论或解决问题。它们能够在广泛的领域执行任务,包括自然语言处理、图像识别、决策等。它们经常被建造得与人类的智力或行为有些相似。

有许多不同种类的代理可能存在;在这种情况下,基于目标的代理是我们的重点。这些代理有明确的目标,他们想要完成,并选择最佳的行动方案来达到目的。

我要求人工智能代理研究一个金融市场的反趋势交易策略。

image.png

以下是派遣代理大军完成任务后的解决方案:

image.png 编码员:ChatGPT-4

AI代理给了我们三个选项。让我们试试最后一个选项,并将其列入提示。

枢轴点策略:这种策略涉及使用枢轴点来确定市场的潜在反转点。当市场达到这些水平时,将采取与当前趋势相反的仓位。

提示语:

注意:在这个例子中,请从提供的链接中复制并粘贴代码。为了简单起见,这里不包括代码。

You are a specialized Python coding assistant for quantitative trading with trading systems and strategies.  
create a new class that inherits from the Abstract_Strategy class, follow this three points:  
1) Use the example as a guide.  
2) Create all the respond within one code block.  
3) Make comments to explain the code.  
  
example: """https://github.com/SmartLever/SmartBots/blob/main/src/domain/services/strategies/rsi_chatgpt.py"""  
  
Query: """I want a counter-trend strategy, the strategy involves using pivot points to identify a potencial reversal points in the market.  
A position is taken against the current trend when the market reaches these levels."""  
Respond: """ """

它是有效的!哇!🤩

第一次尝试就成功了,没有任何调整。从ChatGPT-3.5到ChatGPT-4的进步是显著的。

class Pivot_Points_Strategy(Abstract_Strategy):  
def __init__(self, parameters: dict = None, id_strategy: int = None, callback: callable = None,  
set_basic: bool = True):  
super().__init__(parameters, id_strategy, callback, set_basic)  
  
# Initialize variables  
self.high = None  
self.low = None  
self.close = None  
self.pivot_point = None  
self.support_1 = None  
self.resistance_1 = None  
self.support_2 = None  
self.resistance_2 = None  
  
def calculate_pivot_points(self):  
# Calculate the pivot point  
self.pivot_point = (self.high + self.low + self.close) / 3  
# Calculate the support and resistance levels  
self.support_1 = 2 * self.pivot_point - self.high  
self.resistance_1 = 2 * self.pivot_point - self.low  
self.support_2 = self.pivot_point - (self.high - self.low)  
self.resistance_2 = self.pivot_point + (self.high - self.low)  
  
def add_event(self, event):  
if event.event_type == 'bar':  
# Store high, low, and close prices  
self.high = event.high  
self.low = event.low  
self.close = event.close  
  
# Calculate pivot points  
self.calculate_pivot_points()  
  
# Counter-trend trading logic  
if self.close >= self.resistance_2 and self.position <= 0:  
quantity = self.quantity  
if self.position == 1:  
quantity = self.quantity * 2  
  
# Send a sell order  
self.send_order(ticker=self.ticker, price=event.close, quantity=quantity, action='sell',  
type='market', datetime=event.datetime)  
elif self.close <= self.support_2 and self.position >= 0:  
quantity = self.quantity  
if self.position == 1:  
quantity = self.quantity * 2  
  
# Send a buy order  
self.send_order(ticker=self.ticker, price=event.close, quantity=quantity, action='buy',  
type='market', datetime=event.datetime)  
elif event.event_type == 'tick' and event.tick_type == 'close_day':  
# Update equity strategy at the end of the day if necessary  
self.update_equity(event)

辅导员:学习逻辑

这可能是任何事情,但我要求聊天者详细说明这是如何工作的:

def calculate_pivot_points(self):  
# Calculate the pivot point  
self.pivot_point = (self.high + self.low + self.close) / 3  
# Calculate the support and resistance levels  
self.support_1 = 2 * self.pivot_point - self.high  
self.resistance_1 = 2 * self.pivot_point - self.low  
self.support_2 = self.pivot_point - (self.high - self.low)  
self.resistance_2 = self.pivot_point + (self.high - self.low)

image.png

把这一切放在一起:

  • 正如预期的那样,在2022年的反趋势市场制度中,该股票有一个上升趋势。然而,它在2023年1月开始动摇,表明改变为趋势市场制度。
  • 你可以用SmartBots在5分钟内复制这个股票。这里有一个教程

image.png

经验之谈

  • 指数交易圈是一个有力的想法,它帮助我们在每次突破中磨练交易技能。
  • ChatGPT-4相对于其前身的增强功能还不是开始。
  • 代理商将使我们能够构建我们现在还无法想象的东西。假设我们有一个指数圈,只要按下一个按钮,就能立即实现我们的交易策略,对其进行编程,修复它发现的任何错误,对其进行回测,并在我们得到满意的结果时停止。

订阅我们所有的新闻 这里.

火车进站了,你不能错过它,请加入我们的旅程。我们是一个开放的社区,如果你想与我们合作,请给我们发邮件:andres@smartlever.tech