Author: Always Learning

  • API,OPENAI & Finance Python Project

    High level

    So combining a few of my interests:
    1) Python

    2) Finance

    3) AI

    I have uploaded the script to

    https://github.com/herepete/Fidelity

    Setup steps

    From a AWS Linux Vm

    yum install git
    yum install pip
    pip3.9 install bs4 pandas
    pip3.9 install openai==0.28

    create openai account > https://platform.openai.com/docs/overview, create an API key , add openai key to .bashrc for example

    export OPENAI_API_KEY="bla"


    make sure its visible when running

     env | grep OPEN

    run test api script.py – fix issues
    run option 1 on menu within main.py -fix issues

    run option 2

    High Level Aim

    A script to find a list of income funds i am interested in.

    Then pass that list to openai for some feedback.

    What it does

    Based on the config in config.py

    connect to the Fidelity OpenAi and with the minimal of calls check against criteria namely:

    is it an Income fund?

    does it have a yield over 4%

    is the cost under 1%

    As it produced a return of over 3 in the last 1,3 & 5 years

    If the Api fails for any reason or the criteria is not met reject the fund straight away to reduce the number of API Calls needed.

    If all the tests are passed some extra info is grabbed Last Years Yield, and Overall Morning Star Rating.

    At the end you should have a list of funds which have passed all off the test and then that information is all passed to openai to get some feedback.

    Considerations and Ideas

    I am the first to admit this script needs tweaking and improvement but my aim was to get a first version published rather than having a perfect solution.

    I though about multi-threading or multi-processing to speed everything up, but i don’t want to hammer the API.

    I could do more with the AI i.e langchain but my aim was to get version 1 working.

    I did wonder about getting the results written to a db like sqllite but thats another option for version2

    In the output i could use colour and ask the Openai for more information.

    You need quite a wide screen to display the ouput as designed.

    Maybe play with different openai models to check output.

    Maybe open a chat type windows from the command line to allow you to ask questions about the funds.

    Play with Openai instructions to get better answers, i haven’t done any fine tunning of the commands.

    Files

    config.py – basic config, set testing to 0 if you want to unleash the power! & set any criteria you wish on the other fields

    main.py – main script to run

    test_openai.py – a basic test to check openai is being called, can be run on its own or from the menu in main.py

    failer_test_fund.txt – is a log of what fund errored and why, this is only generated when option 2 from main.py is run. We use the funds here and mark them as Previously checked so we don’t unnecessarily test them again.

    fidelity_funds.csv – this is your master list of funds to consider about 3,000 ish. This file is only generated when option 1 from main.py is run. The first check in option 2 of main.py is looking through all funds names and removing anything with the word “inc” in.

    Typical workflow

    setup enviorement

    download git scripts

    run main.py choose option 1 to create your all files lookup

    run main.py chose option 2 – 10 funds are checked

    edit config.py and change testing to 0

    run main.py choose option 2 – sit back and watch and review results

    Interface

    It’s all Command line but i have tried to make it visualize as nice as possible.

    The page should refresh:

    Income stocks found should be about 1117 ish – is all income funds found in fidelity_funds.csv

    Previously checked – funds found in failer_test_fund.txt, which is failed funds from any previous runs.

    This Round checking – how many funds to check based on Db.config values

    This round rejected – how many funds failed

    This round suitable funds found – how many funds passed

    Verbose stuff – a log of the 10 most recent things than happened

    Basic run with no Funds found

    Basic run with Funds found

    note anything below the line “**Analysis:**” is aI generated.

    A Screenshot didn’t look as good here so i have copied and pasted the output as a code line

    Income Stocks Found           Previously checked            This round Checking           This Round Rejected           This Round Suitable Funds found
    
    1117                          537                           20                            18                            2
    
    Verbose Stuff...
    Starting work on - Rathbone M-A Strategic Growth Port S Inc
    Yield check failure
    Starting work on - Rathbone M-A Strategic Income Port S Inc
    Yield check failure
    Starting work on - Rathbone M-A Total Return Port S Inc
    Yield check failure
    Starting work on - Schroder High Yield Opportunities Z Inc
    Suitable Fund Found=Schroder High Yield Opportunities Z Inc
    Starting work on - Schroder Strategic Credit L Inc
    Suitable Fund Found=Schroder Strategic Credit L Inc
    
    Here are the raw results and the AI feedback on those funds...
    Based on the provided data, here is a comparison of the two income funds:
    
    | Fund Name                           | ISIN          | Fee (%) | Yield (%) | Frequency     | Y1_Annualized | Y3_Annualized | Y5_Annualized | Last Year's Yield | Morning Star Rating |
    |------------------------------------|-------------------------------|--------|----------|----------------|----------------|----------------|----------------|------------------|---------------------
    | Schroder High Yield Opportunities Z Inc | GB00B5143284 | 0.72   | 7.71      | Monthly        | 15             | 3             | 5                | 7.82                 | 5                   |
    | Schroder Strategic Credit L Inc         | GB00B11DP098 | 0.67   | 6.33      | Semi-Annually | 12             | 3             | 4                | 5.90                 | 5                   |
    
    **Analysis:**
    
    **Schroder High Yield Opportunities Z Inc:**
    - **Pros:**
      - Higher yield (7.71%)
      - Monthly frequency of payouts
      - Higher Y1_Annualized return (15%)
      - Higher Last Year's Yield (7.82%)
      - Morning Star Rating of 5
    
    - **Cons:**
      - Slightly higher fee compared to the other fund (0.72%)
      - Lower Y3_Annualized and Y5_Annualized returns
    
    **Schroder Strategic Credit L Inc:**
    - **Pros:**
      - Lower fee (0.67%)
      - Lower fee than the other fund
      - Consistent Morning Star Rating of 5
    
    - **Cons:**
      - Lower yield (6.33%)
      - Semi-annual frequency of payouts
      - Lower Y1_Annualized and Last Year's Yield
      - Lower Y3_Annualized and Y5_Annualized returns compared to the other fund
    
    **Additional Research:**
    - Further research into the credit quality of the underlying assets might provide insights into the risk profile of these funds.
    - Comparison of the fund performance against relevant benchmark indices.
    
    In summary, the Schroder High Yield Opportunities Z Inc fund offers a higher yield and better short-term performance, but at a slightly higher fee. On the other hand, the Schroder Strategic Credit L Inc fund has a lower fee and consistent Morning Star Rating, but with lower yield and overall returns. Investors may consider their investment goals, risk tolerance, and liquidity preferences when choosing between these two funds.
    AI Anslysis completed
  • Creating a Pocket of Magic: How to Spark Change in Your Team and Environment

    Change, whether in life or in the workplace, is never easy, especially when we don’t feel in control. But here’s the secret: you don’t have to be in a position of authority to create powerful change. You can spark it from within your team and environment, influencing not just the people around you but even your boss. It starts with small, intentional actions that create a ripple effect—what Simon Sinek refers to as “a pocket of magic.”

    Here’s how to create that magic and spark lasting change in your environment.

    Focus on the Behavior Around You

    Often, we wait for someone at the top to drive change, especially in professional settings. But real change doesn’t always start from the top. It begins right where you are—by focusing on your team, the people beside you, and yes, even your boss.

    When you actively shape the behavior in your immediate environment, you influence how your peers act, think, and respond. Your small, consistent actions create a pocket of magic—a space where positivity, creativity, and progress thrive.

    Here’s how you can start:

    • Model the Behavior You Want to See: Want a more collaborative and open team? Start by being more collaborative and open yourself. When you actively listen, share ideas freely, and offer help, others will begin to mirror that behavior.
    • Build Trust and Transparency: Whether it’s through one-on-one conversations or team discussions, being open about challenges and triumphs creates a safe space for others to do the same. This builds a foundation of trust, which is crucial for change.
    • Celebrate Small Wins: Every step toward change, no matter how small, is progress. Recognize and celebrate the efforts of your team. This positive reinforcement encourages others to stay on track.

    Focusing on the people around you is key. Change doesn’t happen in isolation—it’s a collective effort. When your team sees your behavior, they’ll begin to align with that energy, sparking their own transformations.

    Create Magical Ripples of Change

    Once you’ve created this pocket of magic in your immediate environment, the next step is to extend its influence. It’s about creating ripples that move outward, touching others beyond your immediate circle. These ripples of change are subtle but powerful, and they can reach far and wide if sustained.

    Here’s where Simon Sinek’s law of diffusion comes into play. According to Sinek, you don’t need to convince everyone to get on board with your vision. In fact, only 15-18% of people need to embrace the change before you reach a tipping point. At this point, the change gains momentum and spreads more naturally to the rest of the organization or team.

    Here’s how to amplify those magical ripples:

    • Engage Early Adopters: Focus on the people who are naturally open to new ideas or who already align with your vision for change. These early adopters are essential because they help spread the message. Once they’re on board, they’ll influence others, extending your reach.
    • Inspire Through Action: People are more likely to embrace change when they see it in action rather than just hearing about it. Show them how the change works in real time. For example, if you’re advocating for more transparency in team meetings, model this by openly sharing information or ideas in your own meetings. Actions inspire more than words.
    • Let Go of Control: Once your ripples start, let go of the need to control every aspect of the change. Trust that the energy you’ve created will continue to spread and adapt in ways you might not expect. Allow others to take ownership of the change, and watch how they make it their own.

    Reaching the Tipping Point

    As your ripples of magic continue, you’ll eventually reach a tipping point. This is when enough people—around 15-18%, according to the law of diffusion—embrace the change, causing a shift in the wider team or environment. The momentum becomes unstoppable, and the change feels almost inevitable.

    At this stage, the most important thing is to maintain the culture of openness, trust, and consistency that you’ve built. The tipping point is a fragile moment—it’s when the change is still taking root but hasn’t yet fully integrated into the fabric of your environment. Continue reinforcing the behaviors that sparked the change, and encourage others to do the same.

    Pocket of Magic: A Sustainable Change

    Creating this pocket of magic isn’t about short-term gains or temporary wins. It’s about creating an environment where positive change is sustainable, where people feel empowered to contribute, and where progress becomes part of the team’s DNA.

    What starts as a small pocket of magic can expand, reaching beyond your team to the entire organization. You might influence how your boss approaches decision-making, or how different departments collaborate. But remember, it starts with you—your behavior, your commitment, and your belief in the change you want to create.

    Conclusion: Change Starts With Us

    Creating meaningful change doesn’t require a title or position of authority. It requires consistency, influence, and a clear understanding of how change spreads through human behavior. By focusing on your immediate team and environment, you can create ripples of positive change that extend far beyond what you might expect.

    When 15-18% of people embrace that change, a tipping point is reached—and suddenly, what once felt difficult or impossible becomes the new norm.

    So, start today. Create your pocket of magic, nurture it with small actions, and watch as it grows, influencing not just the people beside you, but the entire system. The power to change is already in your hands.

    Blog Based on

  • Make Work Enjoyable: A Path to Fulfillment and Success

    In today’s fast-paced world, work often becomes something we dread—a routine obligation we endure to make ends meet. But what if work didn’t have to feel like a burden? What if you could actually enjoy it, finding fulfillment, motivation, and even joy in your daily tasks? It’s not only possible but crucial for a happy and productive life.

    In this post, we’ll explore a few simple yet powerful strategies to help you make work enjoyable. Whether you’re an entrepreneur, employee, or freelancer, these tips can be your guide to transforming how you approach your workday.

    1. Align Your Work with Your Values

    The first step toward enjoying work is ensuring it aligns with your personal values. When your work reflects what you believe in, every task feels more meaningful. Ask yourself: What do I stand for? Whether it’s creativity, helping others, or continuous learning, identify your core values and seek ways to integrate them into your work.

    Example: If learning is one of your values, carve out time during your week to upskill or explore new areas related to your field. This can make even mundane tasks feel like a stepping stone to something bigger.

    2. Focus on Growth, Not Perfection

    Too often, we chase perfection in our tasks, creating unnecessary stress. Instead, shift your focus from perfection to progress. Celebrate small wins and milestones, understanding that growth is the true marker of success. This mindset removes pressure and encourages you to enjoy the learning process.

    Pro Tip: Keep a journal to track your progress and accomplishments. Reflecting on what you’ve achieved can help you stay motivated and positive about your work.

    3. Create a Positive Work Environment

    Your physical and emotional environment significantly affects how you feel about work. A cluttered workspace, negative colleagues, or a lack of organization can drain your energy. Strive to create a work environment that fosters focus, creativity, and positivity.

    • Declutter your space for a clearer mind.
    • Surround yourself with supportive people who uplift and inspire you.
    • Add personal touches to your workspace—photos, plants, or anything that sparks joy.

    4. Take Breaks and Prioritize Well-being

    Work can be exhausting if we push ourselves too hard without allowing time to recharge. Breaks aren’t a luxury; they’re essential for maintaining high energy levels and creativity. Adopt the Pomodoro Technique or schedule short breaks throughout your day to maintain productivity without burnout.

    Moreover, take care of your physical and mental health. Regular exercise, mindfulness, and even short walks can drastically improve how you feel during the workday.

    5. Develop Strong Relationships with Colleagues

    Work is more enjoyable when you have positive relationships with your coworkers. Take time to connect with the people you work with—whether it’s sharing ideas, collaborating on projects, or simply chatting during breaks. Strong interpersonal bonds create a sense of community, making you feel more engaged and motivated.

    Tip: Consider organizing a weekly coffee catch-up with colleagues or participating in team-building activities to strengthen these bonds.

    6. Pursue Passion Projects on the Side

    Sometimes, you may not have complete control over the nature of your work. However, if you pursue passion projects alongside your main job, you can still find joy and excitement in your career. Working on something that aligns with your passions can inject creativity and energy into your life, making even the most monotonous tasks more bearable.

    7. Adopt a Mindful Mindset

    One of the most effective ways to enjoy work is through mindfulness—being fully present in each moment without judgment. When we rush through tasks or constantly worry about future deadlines, we miss the opportunity to engage with what we’re doing. Practice mindfulness by focusing on one task at a time, paying attention to the details, and approaching your work with curiosity and openness.

    8. Celebrate Wins, Big and Small

    No matter how small, celebrating your successes can make work feel rewarding. Recognize your accomplishments and reward yourself in ways that matter—whether it’s treating yourself to something special or simply taking a moment to reflect on your progress.

    Final Thoughts Making work enjoyable isn’t about having the perfect job. It’s about changing your perspective, building positive habits, and aligning your work with what matters most to you. When you approach your work with purpose, positivity, and mindfulness, you’ll find that not only does your work become more enjoyable, but you’ll also become more productive, creative, and fulfilled.

    In the end, happiness at work isn’t a destination—it’s a journey. With the right mindset and tools, you can find joy in the process and achieve lasting fulfillment in your career.

    Blog Based on

  • Find the Small Wins for Momentum and Confidence

    In the grand scheme of life, it’s easy to focus solely on the big picture—the lofty goals, the major milestones, and the significant achievements. However, the path to these grand successes is often paved with numerous small victories. These small wins are not only essential for maintaining momentum but also for building and sustaining confidence. Let’s delve into why finding these small wins is crucial and how you can leverage them to propel yourself forward.

    The Power of Small Wins

    1. Building Momentum

    Momentum is a powerful force. When we achieve small wins, we create a sense of progress. This progress fuels our drive, making it easier to tackle larger tasks. Think of it like pushing a car: getting it started takes a lot of effort, but once it’s moving, it requires less force to keep it rolling. Small wins act as the initial push, helping us build momentum and move steadily towards our bigger goals.

    2. Boosting Confidence

    Each small win reinforces our belief in our abilities. It’s a validation that we are capable and competent. This incremental build-up of confidence is crucial, especially when we face challenging tasks. Confidence gained from small wins provides the mental fortitude to take on more significant challenges without feeling overwhelmed.

    3. Enhancing Motivation

    Small wins generate positive emotions, which boost our motivation. The satisfaction and joy derived from these achievements create a positive feedback loop. The more we accomplish, the more motivated we become to continue working towards our goals. This motivation is essential for maintaining long-term dedication and perseverance.

    How to Find and Celebrate Small Wins

    1. Break Down Your Goals

    Start by breaking down your larger goals into smaller, manageable tasks. For instance, if your goal is to write a book, set smaller targets like writing a certain number of words each day or completing one chapter per month. Each of these smaller tasks is a win that brings you closer to your ultimate goal.

    2. Keep a Win Journal

    Maintain a journal where you record your daily or weekly accomplishments. This practice not only helps you recognize and remember your small wins but also provides a tangible reminder of your progress. On days when you feel stuck or demotivated, looking back at your win journal can rekindle your confidence and enthusiasm.

    3. Celebrate Your Wins

    Take time to celebrate your small wins, no matter how minor they may seem. Celebrations don’t have to be extravagant; even a simple acknowledgment or a small reward can be effective. Celebrating these victories reinforces the positive feelings associated with your progress and keeps you motivated.

    4. Share Your Wins

    Sharing your achievements with friends, family, or a supportive community can amplify the positive impact of small wins. Positive reinforcement and encouragement from others can boost your confidence and create a supportive network that celebrates your progress with you.

    5. Reflect and Learn

    Reflect on each small win and what contributed to your success. Understanding the factors that led to your achievements can provide valuable insights and help you replicate these strategies in future tasks. This reflective practice not only reinforces your learning but also enhances your problem-solving skills.

    Real-Life Examples of Small Wins

    1. Fitness Goals

    If you’re aiming to run a marathon, start by celebrating the completion of shorter runs. Each milestone—whether it’s running a mile without stopping or completing a 5k—builds your endurance and confidence, making the ultimate marathon goal more attainable.

    2. Professional Development

    In your career, set small goals such as learning a new skill, completing a project, or receiving positive feedback from a client. Each of these accomplishments adds to your professional growth and confidence, paving the way for more significant career achievements.

    3. Personal Growth

    Personal development goals, like improving your mental well-being or adopting a new hobby, can also benefit from recognizing small wins. Celebrate moments like successfully meditating for a week or mastering a new recipe. These victories contribute to your overall sense of fulfillment and happiness.

    Conclusion

    In the journey of life, it’s the small wins that often make the biggest difference. They keep us moving forward, bolster our confidence, and enhance our motivation. By recognizing, celebrating, and building upon these small victories, we can maintain a steady momentum and navigate the path to our larger goals with greater ease and joy. So, take a moment to acknowledge your small wins today and watch how they transform your journey towards success.

  • Don’t Let a Surge of Emotion Cause a Negative Spiral: Avoid the Domino Effect

    Emotions are an integral part of the human experience, influencing our thoughts, actions, and decisions. However, when intense emotions surge, they can lead to a negative spiral, much like a row of dominos falling one after the other. Understanding how to manage these emotions is crucial to preventing a cascade of negativity that can impact various aspects of our lives. Here are some strategies to help you avoid letting a surge of emotion turn into a negative domino effect.

    Recognizing the Domino Effect

    The domino effect in the context of emotions refers to how one intense feeling can trigger a series of negative thoughts and actions, leading to more significant problems. For example, a single moment of anger might lead to harsh words, which can damage relationships, resulting in guilt and regret. Recognizing this pattern is the first step in preventing it.

    Strategies to Prevent Emotional Dominos

    1. Pause and Reflect When you feel a surge of emotion, take a moment to pause and reflect before reacting. This brief pause allows you to gain perspective and consider the potential consequences of your actions. Deep breathing, counting to ten, or even stepping away from the situation can help you regain control.
    2. Identify Triggers Understanding what triggers your intense emotions can help you prepare and respond more effectively. Keep a journal to track situations or thoughts that lead to emotional surges. Over time, you can identify patterns and develop strategies to manage these triggers better.
    3. Practice Mindfulness Mindfulness practices, such as meditation and deep breathing, can help you stay grounded and present. These techniques reduce the intensity of your emotions and increase your ability to respond calmly. Regular mindfulness practice can also enhance your overall emotional resilience.
    4. Challenge Negative Thoughts Intense emotions often come with a barrage of negative thoughts. Challenge these thoughts by questioning their validity and considering alternative perspectives. Cognitive-behavioral techniques can be particularly effective in reframing negative thoughts and preventing them from spiraling out of control.
    5. Develop Healthy Coping Mechanisms Healthy coping mechanisms, such as exercise, hobbies, and socializing, can help you manage emotions constructively. Engaging in activities you enjoy can provide a positive outlet for your feelings and reduce the risk of a negative spiral.

    Building Emotional Resilience

    1. Strengthen Your Support System Having a strong support system of friends, family, or a therapist can provide a buffer against emotional surges. Talking about your feelings with someone you trust can offer new perspectives and emotional relief.
    2. Cultivate Self-Compassion Treat yourself with the same kindness and understanding that you would offer a friend. Self-compassion can help you navigate intense emotions without self-criticism, reducing the likelihood of a negative spiral.
    3. Set Boundaries Setting boundaries with others and yourself can prevent situations that trigger intense emotions. Learn to say no when necessary and prioritize your well-being. Boundaries can create a sense of control and stability in your life.
    4. Focus on Solutions When faced with a surge of emotion, focus on finding solutions rather than dwelling on the problem. Problem-solving shifts your mindset from feeling overwhelmed to feeling empowered, reducing the impact of negative emotions.

    Conclusion

    Emotions are powerful and can influence our lives in profound ways. However, by recognizing the potential for a negative domino effect and employing strategies to manage our emotions, we can prevent a single surge from causing a cascade of negativity. Pause and reflect, identify triggers, practice mindfulness, challenge negative thoughts, and develop healthy coping mechanisms. By building emotional resilience and focusing on solutions, you can navigate life’s emotional challenges with greater ease and stability.

    Remember, emotions are a part of being human, but they don’t have to control you. With mindful management and a proactive approach, you can break the chain of negative dominos and create a more balanced and fulfilling life.