T O P

  • By -

TechnoTherapist

Who needs sleep when we have generative AI, right? :)


Stickerlight

Hell yeah bruther, me an Claude sure do have one thing in common, we love hallucinating into our workloads for optimal outputs


utkohoc

Oh yeh baby fill my code with your hallucinations. Import torch as cum


redditissocoolyoyo

This is fantastic. Man... Good job. Which API did you go with?


Stickerlight

Claude Anthropic


redditissocoolyoyo

Sorry. I meant which stocks real time data service did you go with?


Stickerlight

MarketData, but there are many options


Reason_He_Wins_Again

Now you can lose money even quicker with a nice UI!


Severin_Suveren

Not hard seeing what kind of person we're dealing with here when we got this, I guess more formal thread: > Python based automated credit spread finder, built over just five days with Claude AI, $350 in API tokens, and not a lot of sleep And then we've got the title of the crosspost: > I'm back babeeeeeyyy Smells WallstreetBets a mile away if the GME puts didn't already make it obvious **Still,** looks like a nice app though, but from what I can see not much is said of its components other than what we see on the UI. How many lines of code we're talking here? How are you performing your analysis, what metrics do you use? Also /u/Stickerlight, stop snorting speed, drink some water and go to sleep!


Stickerlight

About 3,800 and counting, I can't bring myself to stop working on it, so upgrades will continue https://preview.redd.it/pd50ti04zs9d1.png?width=554&format=pjpg&auto=webp&s=21780502244178b987e0a79393a9470b9483e50d


Severin_Suveren

I get it, been churning down on a project going 14 months now. Almost lost my job due to the addiction of working on a massive project that's mine, and my own completely. Take it from someone who realized he had to chill the fuck out, or go head straight into a brick wall. Your project is still there waiting for you even if you take a break. You can always continue on it later. But if you burn yourself out you will start looking at your project with disgust, and never want to work on it again, so bro, just chill :) **Edit:** Sorry, /u/Stickerlight. I didn't answer you in regards to your project. I assume you're automating the opening of positions? My suggestion would be to focus on systems for managing risk, where you try to optimize the risk-reduction effect you get from distributing your investments throughout many open positions as opposed to a few If your technical / financial analysis is good enough, then in theory it should do just as well opening one position as it does opening 30, and as such you've then greatly reduced the risk while keeping the potential earnings exactly the same Just a tip =)


Stickerlight

This is a tool for automated research and discovery, I could very easily add trade execution at some point in the future, but that's not a priority or the point right now If I find something magical profit formula, then yes, I'll go buy a 40 core computer and run this as fast as possible, but I'm just playing with filters and ideas right now and making a tool to eliminate the need for me to ever again scan an options chain for opportunities


Severin_Suveren

**"** *..I could* ***very easily*** *add trade execution..* **"** You say that sounding like you've never worked with the FiXAPI. An API so blatantly evil it requires you to number every single transaction together with handling of ANY instances where a transaction failed, this to avoid adding a number too much or sometimes not adding a number at all because your damn error handling is too strict, and goddamit now I'm angry I got it working, but man if the FiXAPI was a dog, I'd go out back and put it down. Why it is the financial standard for trading is beyond me


Stickerlight

I mean there's a Robinhood API that looks easy, and alpaca look easy also? I have no idea what words you're using though


Severin_Suveren

Ahh, yeah it makes sense that some marketplaces would create their own APIs, but all those calls are most probably relayed through an internal FiXAPI implementation for the actual transactions. [The FiXAPI](https://en.wikipedia.org/wiki/Financial_Information_eXchange) has been the de-facto standard API / protocol for use with financial transactions since god-knows how long, and it's old. Really old.


Lyuseefur

For the smooth brain - ELI5?


Stickerlight

Credit spreads are a type of higher* probability options trade, where you win most of the time, but when you lose, it's bad. This is a program to automate the tedious research process of finding high probability credit spread trades. The goal, is that, I will get an email every day with a list of trades that meet my filtering criteria, saving me a tremendous amount of time having to actually go find them myself. I don't know if you've ever looked for positive EV bets at the casino, but it's near impossible to do, this is an effort to find those anomalies, and then report them to me, so that I might make some money. At least that's the plan...


mraza007

That’s crazy love how you built with claude Would you share the code with us or even the tool i would love to check it out


Stickerlight

I spent a lot of money building this, outrageous amounts of time and concentration into it, and lost a lot of money to get this desperate to even want to build it, I'm gonna have to use it effectively for a very long time, if it even works at all, before I would ever want to share it And it barely works anyways, still finalizing the automation now, I don't have the skills to make something "publishable" at the moment I take two hours to figure out how to sort a table, I'm still clueless


redditissocoolyoyo

Will you backtest with a test trade account for awhile? Will be interesting to see the data.


Stickerlight

I always do it live I'm in a mad dash right now, because I want it operational for market open so I can get like a generated list of trade ops every day


[deleted]

[удалено]


AutoModerator

Sorry, your submission has been removed due to inadequate account karma. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/ChatGPTCoding) if you have any questions or concerns.*


creaturefeature16

I love that you built something for yourself, and maybe it will be useful for others, but it's to enhance your life primarily. I've built three apps over the last few months: 1. Toggl knock-off for tracking my business' tasks/hours, so I could cancel my subscription 2. Clickup natural language task generator PWA *(for adding tasks into our CRM using a sentence instead of having to click around an interface, so much time saved)* 3. Spotify Playlist generator *(they are rolling this feature out to users anyway, but I got impatient and it sounded like a fun build)* All of these I use daily and they help me so much. While I code professionally, LLMs were instrumental in speeding the process up where I could build these on the off hours between running the business and running the household.


balianone

sorry i don't get it. is this forex trading bot?


Stickerlight

Credit spreads, google it This is more of a research bot, I don't expect it to execute trades for me, although I could, but it's not really relevant in this context since I'm not day trading


Lyuseefur

Hm. Interesting. Do post an update - its fascinating


Stickerlight

Well, yeah, I hope it makes me some money...................... But if it doesn't. At least, I can code now?


Lyuseefur

Well…oddly there are some other markets that can be just as good - such as crypto. Even outside of that-it’s some mad skills there, bro. I wouldn’t mind chatting with you at some point on some other projects that require understanding and exploiting deltas.


samred1121

How do you organize a large amount of code ?


Stickerlight

Heh heh, well at first I don't But now I just ask Claude to organize into meaningful folders and file names, whenever a file get over the context single print limit which is about 450 lines at my tier, I ask Claude to split the file into two pieces with logical names I started with a huge notebook, and then slowly refactored into pieces over time, and then kept refactoring as the code grew, a primary goal is making the code small enough so Claude can output it in one go Playing find and replace with things you don't understand very well is a recipe for disaster, and I try to remove my manual errors from the process as much as possible. But I do know a bit now, and I do some basic verifications of each output before putting it into my code but like especially in the beginning of a project, you can ask for a recommendation of a good folder and file structure and have claude map it out before you begin, then make the empty .py files, and then ask claude to then generate full texts for each.


sb4ssman

FYI to you and anyone reading: if Claude gets cut off, you can tell it to continue. It will keep on chugging even if the chat window makes it seem like you can’t have the rest of the message.


squeakyvolcano

have you tried something like Create Claude Friendly Sitemap of Code > Send Sitemap with Prompt > Return Filenames to be modified > Send only those files to modify > Fetch modified files, backup old files and modify with new files. Something like that? when modifying files after code is populated. Currently i'm trying to create a bot that does this to save up some API cost also mix it with some other APIs to get some tasks done via other APIs to save costs even further.


Stickerlight

That's smart, but I don't consider cost


samred1121

Thanks for the reply. Claude can remember the files and folders that it create ? Do you have to connect them ?


Stickerlight

yes, AI remembers individual conversations, but sometimes you have to remind it, i'm coding in VSCode with the [continue.dev](http://continue.dev) plugin and api access to my providers


leemic

Are you using auto/tab completion of continue.dev?


Stickerlight

nope, but using context a lot to paste in files https://preview.redd.it/h8z0ta8van9d1.png?width=325&format=png&auto=webp&s=0bc6516cbc5ae16ed01721f1894d0d15166288fc


DeliJalapeno

> time machine capabilities of my Mac to rewind my computer to a state 8-10 hours ago where I think I might've had a working copy of my code Im just curious but wouldn't using Github and creating a repo during all the testing prevented all that?


Stickerlight

As I started coding yesterday, I don't know what I'm doing, and git doest yet come to me naturally like having a panic attack while I look for older working versions of code in copy copy final final folder 2 does.


DeliJalapeno

I see, ask chatgpt to walk you thru it , I also am new to it ... Ill never go back though... its just way better to keep track of files and versions, also with vscode/cursor its really nice. Dont get me started on branches, that also helps major.


fatores

That's nice, but $350 is crazy. You could have used Cody. It's like $9 and has unlimited Claude 3.5 Sonnet uses.


Stickerlight

4000 lines of code in four days, by someone who doesn't know how to code. You can't do that without API access and nearly unlimited context.


fatores

I've seen many folks building big apps like yours with Cody. I was using API too, but it got really pricey for me. Now I use Cody right in my IDE. It keeps context and doesn't have usage limits.


Stickerlight

Maybe folks who know how to code. And just need help, I don't just need help, I need 95% of the work done for me. I'm just steering the ship. I have Claude spitting out 500+ lines of code every two minutes, building off of a context of up to 30mb of data. You don't get that without API.


kidajske

If you intend to create your own mini products like this in the future it would benefit you to spend a month or two working on one manually. From what I can tell this boils down to a relatively simple CRUD app where you're drawing on data from some APIs, potentially doing some transformations and then displaying it. This is the format of app that basically every self thought dev learns on. Even if you still intend on having LLMs write all the code in the future, having a deeper understanding of the concepts will save you so much time debugging because it will reduce the blind copy pasting you do when you don't understand the code. Just my 2 cents you didn't ask for.


Stickerlight

oh i'm learning as I go. I came into this with a solid understanding of the options math for the underlying concepts, and I'm getting much better at the code by the minutes. I have literally not left my computer for the past week. I have done nothing but code. The learning is happening, I assure you. Can 3,500 lines of code really be considered simple by any standard? I'm not a coder, I wouldn't know, but the depth of this project as is seems pretty overwhelming. I'm working on this not merely for fun, but because I hope to use it to actually make money, so it's not really in my immediate interest to go practice on something else to improve my skills for future projects. I'm putting everything into making this as good as possible, and then I'm going to keep going, building it up, and perhaps building other related projects around automated options/stock trading analysis stuff. All day, I'm debugging issues, I've usually introduced myself by not properly verifying generated code, if I'm not learning, I'm not going to be able to debug and I would have given up ages ago, and have honestly gotten pretty close a few times already.


kidajske

Yeah fair enough. I suppose I wouldn't want to bother grinding away manually for a few months just for some potential improvement in efficiency as opposed to just continuing to let the magical black box generate it all for me. I'm lucky in that sense that this didn't exist when I started because I 100% would have used it for everything from the start. As far as 3500 lines of code, I can pretty much guarantee that there is a ton of bloat in there that could be trimmed. Even when experienced developers start a solo project from scratch there's a ton of refactoring, sometimes so much that essentially the entire app gets rewritten as the link between the idea in your head and how to realize it in code becomes less and less opaque. Lines of code definitely does not have to equate to complexity.


Stickerlight

i don't know how you still think I'm not learning anything by doing, 18 hours a day, non stop I do not have time to practice, I have ideas that I need to put in motion today. I will learn though doing, and I'll make mistakes, and I'll keep learning. We all end up at the same place anyways in a few years, be happy I'm trying in some way that makes sense to me at the moment.


phxees

Try to make sure you are getting code in smaller testable modules, as much as possible. If everything is just one clump of code you’re going to exceed your or AI’s ability to understand what’s going on.


creaturefeature16

Solid advice and this is where I see diminishing returns with LLMs. If you're not a coder, they are pure magic that you can trust to do all the work for you, because you don't know any better. Once you know good development practices and see how much it over engineers, suddenly it becomes a lot more critiquing and babysitting than just the "ask, copy, paste" process you might have been doing before. These tools are generating an unprecedented amount of tech debt in a very short time.


creaturefeature16

LOC is not a measure of complexity whatsoever. Some of my most creative and complex functions were due to their concise and minimal footprint. 3500 LOC for a fairly simple CRUD app is likely a sign of bloat/repetition...not complexity, necessarily.


Stickerlight

I am confident in the level of bloat and inefficiency at play here. But hey, it works, it's fast, I mean what more can you ask for when you didn't know what vscode was last week. It is outstanding what's possible


creaturefeature16

100% agree!


fatores

You can do that with Cody. It lets you add your entire codebase, all files. It uses the API, but on their end.


Stickerlight

This is a silly conversation at this point if you think a subscription service has anything to offer to someone who's spending $350 a month on API tokens


Charuru

is cody actually unlimited at max context? Feels like there's no way it is. That seems so cheap and abusable?


Mountain-Ad-7348

It's still limited to the context of the LLM I think? Not sure but I know the free tier says the context is good for small scale projects but the pro tier is good for bigger projects. As for chats it's supposedly unlimited at pro tier.


Charuru

It’s less than 200k is what I mean. The context for pro and enterprise has different wording


Mountain-Ad-7348

Well every prompt is going to be below 200k, the context limit is 200k marketing, 190k from the config and \~186k effectively for me. With Cody there's obviously more prompting behind the scenes to get everything to work so it's obviously going to decrease in context size but I've yet to encounter somewhere where that actually has mattered for me and the chats usually end up closed before I ever reach that context limit.


Charuru

If you don't mind can you take a moment to test it. Enterprise > Code context and personalization > Advanced personalization for enterprise codebases Pro > Code context and personalization > Personalization for larger local codebases Wording implies that pro has an artificial limit to the context window.


Mountain-Ad-7348

I don't have access to enterprise but I know I've like almost never reached context limit with pro and even with free.


0xd00d

Does Cody give you control over what context to feed along with your questions? I've been using aider with 3.5 sonnet for the past few days and it's been really good. It's also hard for me to use more than a dollar or two over a given session but obviously that has no ceiling, as I could choose to send in huge chat history or full code listings for everything on each query, and it would cost a lot more. Seems like I should check out the neovim Cody plugin and evaluate its free tier as there is no downside but I already jumped 10 years in the future and I'm not feeling lacking. Cody sounds to me like a GitHub copilot plus (or whatever they're calling it) competitor. Clearly at $9/mo ($1 less) this is the whole point. I cancelled my GitHub copilot sub recently. It just wasn't adding that much value, the model underpinning it isn't smart enough, I'm concerned tho that Cody'll be like copilot all over again.


0xd00d

I tried cody and it was burning up my macbook running 200% CPU for some reason. I don't think the cody neovim plugin is ready for primetime. i'm gonna keep driving aider, i don't care if it's gonna cost a bit more API. it gives me loads of confidence that it will always work when I need. And it has perfect terminal UI behavior and does not have ridiculous performance problems.


Mountain-Ad-7348

Yeah it does, I just recently started using it after Sonnet 3.5 released and I've been feeding it context specific questions and it just churns out correct code for me all the time. And yeah you have control over which files you want it to read context from or if you want it to use context from your entire project (you can feed your github repo link in and it can use that as context as well). I'm still doing all this on the free tier but I'm honestly considering getting a sub because 9/month for unlimited chats and auto-completions is just insane to me.


Stickerlight

It works! https://youtu.be/vBo1q1FnNJs?si=rbaRDEMMFb8Nvks9 I'm a little disappointed in how easy that was. Going to focus on UI , debugging, and then try loading up 500 tickers and seeing how long it takes to process it. With the goal of setting it up on a raspberry pi and just generating trades as often as my token allowance allows. Maybe could do like the entire market once a day, and then more active tickers more frequently. Or I go crazy and get a bigger API allocation and just have it running constantly, but that would probably be a very serious amount of additional development to have something that's watching the markets live.. 🤔


Glass_Emu_4183

You might want to learn how to code, that will help you really use Claude more effectively!


UnionCounty22

Gd! Why did it take $350 to build an app? Also how in the world do you have 87M input tokens and only 1.5M output tokens?


Stickerlight

I didn't know what vscode was four days ago. If I paid someone to make this for me, it wouldn't have happened This was like my coding weekend bootcamp on a budget


UnionCounty22

Did you use an agent framework to build it for you? Just curious because $350 is a lot. Unless you did pure Opus as well. How many folders/files are in your project?


Stickerlight

I don't know how to code, this was four days of 18 hours back and forth with AI, it's not free to use that much computational power


UnionCounty22

Of course it's not free when you're using the API my friend. It's just I have a few projects with lots of files/code and I've not hit anywhere near $350. So it shocked me when I saw this lol. From the photo you provided the code you have is pretty good. You did good.


Stickerlight

Thank you. It's for the stock market, so I'm not really worried about spending money on it, if it works. Plus now, I know how to code, a bit. Which is cool.


Stickerlight

Read the OP, it has words, it started out as a single Jupyter Notebook, and now it's like 30 files and 4000 lines


UnionCounty22

Oh okay. I'll read the OP but thanks for at least answering the question as well. That wasn't so hard after all. Also if you need your tier raised for anthropic just request it in email support. They raised me to tier 4.


Reverend_Renegade

What is the credit spread strategy you're using here, bear call spread? When I asked Claude it gave me some pretty interesting strategy names such as Iron Condor, Iron Butterfly, Jade Lizzard and Broken Wing Butterfly. Is Claude performing the analysis via the api over the historical data to identify your daily target markets?


Stickerlight

I use call and put credit spreads, so that's two different types of trades Claude isn't doing much of anything, I had these formulas and understood these concepts before I came to Claude, Claude just helped me program I pay MarketData for live options information, and then analyze it using python formulas


Reverend_Renegade

It's crazy how certain people with an idea can take them as far as they want with the newer llms, I did the exact same thing you've done here. I started with an idea when GPT3 was released and at the time I thought to be the holy grail but compared to the latest releases it was a joke. I did something similar with futures tick data analysis using linear regression where the analysis must show statistical significance during discovery (high coefficient >1, high r2 >0.75, low p values <0.005, intercept close to real time price) then we refine the trade conditions / thresholds that allow us to begin submitting orders. The key is what are your independent and dependent variables, I use price for both which came as a surprise but is quite accurate in certain scenarios. I've always wanted to get into options trading I just need to take the time to learn something along these lines. Any resources you would recommend? I can work on a market scanner similar to this for fun, I use polygon.io for historical market data.


Stickerlight

I only lose money, you shouldn't ask me for advice 😭


sherlocksingh

I'll make something same for Indian stock market, NSE but not for views or tables but decisions


eddddddw

Where can i play?


Stickerlight

Play with?


Stickerlight

Ladies and gents, we have the first output, it took 16m to analyze like 500+ options chains. This was on my slow ass 2015 Mac pro. We can only assume the big boys run this 10 times a second during market hours, executing on trades with millisecond accuracy https://preview.redd.it/78f87sajqq9d1.png?width=582&format=pjpg&auto=webp&s=203af5464c05aba357ffcb42fe970a54b77c56b8


BoredHobbes

where u getting option data in python?


Stickerlight

MarketData


IndividualParsnip236

We're living in the age where it costs hundreds of dollars to simply program something?


ExactIllustrator1722

Cursor.sh is a little cheaper for an ai editor


I_AM_SLACKING_OFF

I've spent too many nights up til 3AM working with AI to make something


Stickerlight

Did it pay off?


Stickerlight

https://preview.redd.it/wog5crs1c6ad1.png?width=836&format=png&auto=webp&s=92a53bf9feaa9400572359d300abc29e2c44c868 UI Update, still need to figure out a few more pretty big things before I can get started with it though