Skip to content

Forum in maintenance, we will back soon πŸ™‚

automating forex ne...
 
Notifications
Clear all

automating forex news

14 Posts
3 Users
3 Reactions
35 Views
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

I am trying to use the same method used in one of @hassan videos on Youtube to try generating forex news forcast. I honestly couldn't. My question is, is it possible with the same method.?

Β 

 
Posted : 08/29/2023 3:52 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

Hi, which method you are talking about? and what is the script you are trying with. please share details to help

 
Posted : 08/30/2023 7:50 am
SSAdvisor reacted
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

@admin

Okay Boss. I am just a junior python scripter. But I saw one of your YouTube videos where you generated Bitcoin forecast using API key plus python scripts with ChatGpt. Now I want to do this same thing but this time I only want to forecast  the fundamentals (news) of each currencies to determine when a particular currency is in good condition to trade it in the forex market. 
Using the same method you used in that video of GenerateBitcoinprice  script that you did. 
 
Posted : 08/30/2023 1:41 pm
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

@adminΒ 

import openai
import requests
import json
import streamlit as st
openai.api_key = "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"
def BasicGeneration(userPrompt):
Β  Β  completion = openai.ChatCompletion.create(
Β  Β  Β  Β  model ="gpt-3.5-turbo",
Β  Β  Β  Β  messages=[
Β  Β  Β  Β  Β  Β  {"role": "user", "content": userPrompt}]
Β  Β  )
Β  Β  return completion.choices[0].message.content

def Getfundamentals():
Β  Β  #define the API endpoint and query parameters
Β  Β  url = "https://real-time-finance-data.p.rapidapi.com/search"

Β  Β  querystring = {"query":"Apple","language":"en"}

Β  Β  headers = {
Β  Β  "X-RapidAPI-Key": "e7c783cb9emshf148a0e453c5489p1a5efajsn7aa8cd54f189",
Β  Β  "X-RapidAPI-Host": "real-time-finance-data.p.rapidapi.com"
}

Β  Β  response = requests.request(
Β  Β  "GET", url, headers=headers, params=querystring)
Β  Β  #parse the response data as a JSON object
Β  Β  JSONResult = json.loads(response.text)
Β  Β  #extract the "history" field from the JSON response
Β  Β  history = JSONResult["data"]["history"]
Β  Β  #extract the "price" field from each element in the "history" array and add to a list
Β  Β  values = []
Β  Β  for change in history:
Β  Β  Β  Β  values.append(change["values"])
Β  Β  Β  Β  #join the list of prices into a comma-separated string
Β  Β  Β  Β  pricesList = ','.join(values)
Β  Β  Β  Β  #return comma separated list of prices
Β  Β  Β  Β  return pricesList
Β  Β 
if st.button('Analyze'):
Β  Β  with st.spinner('Getting Prices...'):
Β  Β  Β  Β  fundamentals = Getfundamentals()
Β  Β  Β  Β  st.success('Done!')
Β  Β  with st.spinner('Analyzing Fundamentals...'):
Β  Β  Β  Β  ChatGPTPrompt = f"""You are an expert forex trader with more than 10 years of experience

Β  Β  Β  Β  Β  Β  I will provide you with realtime financial data

Β  Β  Β  Β  Β  Β  can you provide me with a fundamental analysis of usd based on this data. here is what I want:

Β  Β  Β  Β  Β  Β  Price Overview,

Β  Β  Β  Β  Β  Β  Moving Averages, Relative Strength Index (RSI),

Β  Β  Β  Β  Β  Β  Moving Average Convergence Divergence (MACD),
Β  Β  Β  Β  Β  Β  Inflation rate,
Β  Β  Β  Β  Β  Β  GDP
Β  Β  Β  Β  Β  Β  etc

Β  Β  Β  Β  Β  Β  Advice and Suggestion,

Β  Β  Β  Β  Β  Β  Do I buy or sell?

Β  Β  Β  Β  Β  Β  Please be as detailed as much as you can, and explain in a way any beginner can understand

Β  Β  Β  Β  Β  Β  Here is the price list: (bitcoinPrices)"""
Β  Β  Β  Β  print(fundamentals)
 
Posted : 08/30/2023 2:41 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

In the video, I mentioned it is just a demo and don't use for rea trading. What you are looking for requires a deep understanding of trading before doing anything. and am not specialized in this field.

 
Posted : 08/31/2023 1:14 pm
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

@adminΒ 
I have 4 years of experience in trading sir and I am not using this to make my decisions. however, I always go through a lot of stress trying toΒ 
get news releases and Technical analysis before taking action on my trading. I am very confident that this will help me a lot in reducing
the stress I have to go through researching. please help (this is why I need this skill) ThanksΒ 

Β 

This post was modified 1 year ago by SULAIMON OKUNOYE
 
Posted : 09/02/2023 9:10 am
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

Posted by: @admin

In the video, I mentioned it is just a demo and don't use for rea trading. What you are looking for requires a deep understanding of trading before doing anything. and am not specialized in this field.

I believe this can be automated just for fundamental and technical analysis. pls help me. thanks boss

This post was modified 1 year ago by SULAIMON OKUNOYE
 
Posted : 09/02/2023 9:17 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@sulaimon-okunoye In your code snippet you exposed API keys to the public. You should now invalidate those keys and create new ones.

So that I understand you're looking to summarize financial news from sources you trust for particular commodities, am I correct?

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 09/02/2023 12:23 pm
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

@ssadvisor yes yes. You are so correct. Thanks

I think I was just in a hurry

 
Posted : 09/04/2023 11:12 am
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

Β 


@admin

@everyone

good morning from here boss. so I was able to successfully generate the information I need withΒ  rapidapi. but the issue now is that;

1. the information is not printing on the streamlit interface, it just shows done!

2. the information is being generated with so much links to other websites and many more unnecessary info on the terminal.Β 

3. ChatGPT is not giving suggestions like I passed to it in the prompt.Β 

please I need advice.. thanks

Β 

Β 

This post was modified 1 year ago by SULAIMON OKUNOYE
 
Posted : 09/05/2023 10:51 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@sulaimon-okunoye do you realize that RapidAPI and Streamlit are used to create an API that you then use to retrieve data to process in yet another program? An API is a backend process while you are trying to give a frontend view.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 09/05/2023 6:18 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

@sulaimon-okunoye please publish your code to Git Hub and share it with us.

or share your main script so we can check. maybe you are missing to chaning the API response with the prompt, and you missed printing the output with streamlit

 
Posted : 09/06/2023 8:56 am
(@sulaimon-okunoye)
Posts: 11
Active Member Customer
Topic starter
 

@admin I've been able to rectify it. Thanks so much.

Β 

 
Posted : 09/06/2023 7:53 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

@sulaimon-okunoye Great!

 
Posted : 09/07/2023 9:34 am
Share:
[the_ad_group id="312"]