[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-732978-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-732978-en":130,"doc-similar-732978":162},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","opus-47-trading-bot-setup-guide","Opus 4.7 Trading Bot - Setup Guide","","A blueprint for building a fully autonomous, cloud-scheduled trading agent using Claude Code, designed for end-to-end replication by pasting the guide into a session. The agent places real paper trades on Alpaca, generates daily research, follows hard-rule swing-trading constraints for stocks only, manages memory via Git, commits state changes each run, and sends chat notifications. Includes prerequisites, daily cron-job workflows, repository layout, and detailed setup and troubleshooting sections.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/opus-47-trading-bot-setup-guide/732978/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/opus-47-trading-bot-setup-guide/732978.png","ImageObject",300,407,{"name":42,"@type":43},"SALUTone","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-26","2026-11-22",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What does the Opus 4.7 trading bot do each day?","Question",{"text":62,"@type":63},"It runs five weekday cron jobs that research catalysts, execute planned trades, manage trailing stops, scan and cut losers, and send daily and weekly chat summaries. Each run clones the repo, reads memory, pulls account state, decides actions, then writes and commits updated memory.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"What trading rules does the strategy enforce?",{"text":67,"@type":63},"It is swing trading for stocks only, with no options. The bot caps open positions and risk per position, limits new trades per week, requires a 10% trailing stop as a real GTC order, exits losers at -7%, and tightens stops when gains hit +15% or +20%. It also avoids stop tightening within 3% of current price.",{"name":69,"@type":60,"acceptedAnswer":70},"How is the bot designed to be stateless between runs?",{"text":71,"@type":63},"All memory lives in the Git repository as markdown files. Every scheduled run is a fresh LLM invocation with a well-defined prompt, so failures self-heal on the next tick without a separate persistent Python bot process.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},732978,1795383155,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":33,"preview_urls":145},5909897206756,"https://ap-avatar.wpscdn.com/avatar/5600152dbe4a7e99502?x-image-process=image/resize,m_fixed,w_180,h_180&k=1792654152478566863","Opus 4.7 Trading Bot—Setup Guide  \nA complete blueprint for building an autonomous, cloud-scheduled trading agent on top of  \nClaude Code.  \nDesigned to be self-contained: paste this document into your own Claude Code session and it should have everything needed to replicate the system end-to-end.  \nThe agent places real trades on Alpaca, writes its own daily research, executes a disciplined strategy with hard rules, and notifies you via chat. It is stateless between runs—all memory lives in your Git repo.  \nPrerequisites: a Git Hub account, an Alpaca brokerage account (paper is fine to start) , a Perplexity API account, a ClickUp account, and access to Claude Code cloud routines.  \nBy: Nate Herk  \nTable of Contents  \n1. What You're Building  \n2. The Trading Strategy  \n3. Repository Layout  \n4. The Three Wrapper Scripts  \n5. The Five Workflows in Detail  \n6. Memory Model  \n7. Setting Up Cloud Routines  \n8. The Prompt Scaffold  \n9. First-Run Troubleshooting  \n10. Replication Checklist  \n11. Notification Philosophy  \n12. Appendix A—CLAUDE. md Starter  \n13. Appendix B—env.template  \n14. Appendix C—[scripts/alpaca.sh](scripts/alpaca.sh)  \n15. Appendix D—[scripts/perplexity.sh](scripts/perplexity.sh)  \n16. Appendix E—[scripts/clickup.sh](scripts/clickup.sh)  \n17. Appendix F—The Five Routine Prompts  \n18. Appendix G—Ad-hoc Slash Commands  \n19. Appendix H—Starter Memory Files  \nPart 1—What You're Building  \nA fully autonomous trading agent that runs on a daily schedule. Five cron jobs fire throughout each weekday, each one spinning up a fresh Claude Code cloud container that clones your repo, reads memory, pulls live account state, decides on action, places real orders if warranted, writes new memory, commits everything back to Git, and sends you a chat notification.  \nThere is no separate Python bot process. Claude is the bot. Every scheduled run is a fresh LLM invocation reading a well-defined prompt.  \nThe five daily jobs at a glance  \n• Pre-market (early morning) : research catalysts, write today's trade ideas to the research log.  \n• Market-open (shortly after the bell) : execute planned trades, set trailing stops on every new position.  \n• Midday: scan open positions, cut losers, tighten stops on winners.  \n• Daily summary (late afternoon) : snapshot portfolio state, send chat recap.  \n• Weekly review ( Friday afternoon) : compute weekly stats, grade performance, update the strategy if needed.  \nWhy this design  \nThree properties drove every decision:  \n• Stateless runs—each firing is independent, which means failures self-heal on the next tick.  \n• Git as memory—every piece of state is a markdown file committed to main. Free versioning, diffs, rollback, and human-readable audit trail.  \n• Hard rules as gates—strategy discipline is enforced programmatically before every order, not left to interpretation.  \nPart 2—The Trading Strategy  \nThis is a swing trading strategy for stocks only. The logic is simple; the discipline is the hard part. These rules exist because they were learned the hard way in a previous 30-day live challenge where tight stops shook the bot out of winners repeatedly, overtrading cost several percent in one bad week, and a single options trade wiped out a full month of gains.  \nHard rules ( non-negotiable)  \n• No options. Ever. Stocks only.  \n• Maximum 5-6 open positions at a time.  \n• Maximum 20% of equity per position (about $2 ,000 on a $10 ,000 account) .  \n• Maximum 3 new trades per week.  \n• Target 75-85% of capital deployed.  \n• Every position gets a 10% trailing stop placed as a real GTC order on Alpaca. Never mental.  \n• Cut any losing position at-7% from entry. Manual sell. No hoping, no averaging down.  \n• Tighten the trailing stop to 7% when a position is up +15% . Tighten to 5% when up +20% .  \n• Never tighten a stop to within 3% of current price. Never move a stop down.  \n• Exit an entire sector after 2 consecutive failed trades in that sector.  \n• Follow sector momentum. Don't force a thesis if","cbCaifF0DCFG6HKK","https://ap.wps.com/l/cbCaifF0DCFG6HKK","pdf",461696,28,"English","# What You're Building\n## The Trading Strategy\n# Repository Layout\n## The Three Wrapper Scripts\n## The Five Workflows in Detail\n# Memory Model\n## Setting Up Cloud Routines\n## The Prompt Scaffold\n# First-Run Troubleshooting\n# Replication Checklist\n# Notification Philosophy\n# Appendix A—CLAUDE. md Starter\n# Appendix B—env.template\n# Appendix C—scripts/alpaca.sh\n# Appendix D—scripts/perplexity.sh\n# Appendix E—scripts/clickup.sh\n# Appendix F—The Five Routine Prompts\n# Appendix G—Ad-hoc Slash Commands\n# Appendix H—Starter Memory Files","[{\"question\":\"What does the Opus 4.7 trading bot do each day?\",\"answer\":\"It runs five weekday cron jobs that research catalysts, execute planned trades, manage trailing stops, scan and cut losers, and send daily and weekly chat summaries. Each run clones the repo, reads memory, pulls account state, decides actions, then writes and commits updated memory.\"},{\"question\":\"What trading rules does the strategy enforce?\",\"answer\":\"It is swing trading for stocks only, with no options. The bot caps open positions and risk per position, limits new trades per week, requires a 10% trailing stop as a real GTC order, exits losers at -7%, and tightens stops when gains hit +15% or +20%. It also avoids stop tightening within 3% of current price.\"},{\"question\":\"How is the bot designed to be stateless between runs?\",\"answer\":\"All memory lives in the Git repository as markdown files. Every scheduled run is a fresh LLM invocation with a well-defined prompt, so failures self-heal on the next tick without a separate persistent Python bot process.\"}]","Opus 4.7 Trading Bot - Setup Guide | PDF",71,[146,150,154,158],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-22/0fc3c9f45aa696e992ce8e4060257ecc.webp",983,1272,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-22/16bbb26742d35e24a4533b4b92ae1735.webp",982,1270,{"page_no":30,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-22/c8416ba3421bd703e265624b066dba38.webp",981,1269,{"page_no":33,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-22/95ee9e801cb8791f68461b3a7333bcc0.webp",980,1268,{"list":163,"token":11},[164,170,176,182,188,194,200,206,213,220],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":105,"category_name":29,"create_tm":169},693045,"Git Tutorial","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230004257911/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=KxrN0Cxy8v97V1xIr8%2BK%2BDKXu2A%3D","git-tutorial",1794246577,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":26,"category_name":29,"create_tm":175},760090,"Git-0 to Pro Reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044495433/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=i0ogvCLaiK8L8xBt7SXLO3UsUWM%3D","git-0-to-pro-reference",1795898473,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":105,"category_name":29,"create_tm":181},682038,"Git Guide - Git collaboration and core commands","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332702/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=poQAOVv2KlN5u560Ueg%2BWtqSH6w%3D","git-guide-git-collaboration-and-core-commands",1793958643,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":22,"category_name":29,"create_tm":187},760084,"A Lightweight API for Git - Version 0.1.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044495419/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=kcy8oqfYSdMVz63rWCDpsT4SM7E%3D","a-lightweight-api-for-git-version-010",1795898460,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":33,"category_name":29,"create_tm":193},686585,"The Git version control system - An introduction to the Git version control system - Felix Gruber","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001039806/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=aXj9uXNvOB1nh55RENrLOmq9sUM%3D","the-git-version-control-system-an-introduction-to-the-git-version-control-system-felix-gruber",1794057221,{"doc_id":195,"doc_title":196,"file_type":137,"home_preview_img_url":197,"slug":198,"view_count":22,"category_name":29,"create_tm":199},760730,"GitHub for Developers Training Manual - v1.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044249605/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=RuP3pT0keX6qGpJo8TInSyfHjLY%3D","github-for-developers-training-manual-v10",1795908755,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":101,"category_name":29,"create_tm":205},657566,"Git and GitHub Terms and Diagrams - Presenter Steve Baskauf","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975111111/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=5fxwGvgggVyZGUCqd6dtdpfausU%3D","git-and-github-terms-and-diagrams-presenter-steve-baskauf",1792983193,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":211,"category_name":29,"create_tm":212},82767,"SkillFab: An Agent-Native Skill Production Platform","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808908411/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=1aDZX1XJ8VivsQQSLA%2F7QUks3Fo%3D","skillfab-an-agent-native-skill-production-platform",25,1784182812,{"doc_id":214,"doc_title":215,"file_type":137,"home_preview_img_url":216,"slug":217,"view_count":218,"category_name":29,"create_tm":219},329593,"SMART MONEY TOOL DIVERGENCE STUDY FOR SWING AND DAY TRADES","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229909517238/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=2fzsWEafXsJfvW7%2FSV8D0EHMoXs%3D","smart-money-tool-divergence-study-for-swing-and-day-trades",35,1789984682,{"doc_id":221,"doc_title":222,"file_type":137,"home_preview_img_url":223,"slug":224,"view_count":225,"category_name":29,"create_tm":226},300655,"Inner Circle Trader - The Power of Three - Trading Strategy - Time & Price Theory","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229905572098/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796108879&Signature=%2BugxcrLknbfY1MnXAVJFbvrEvHI%3D","inner-circle-trader-the-power-of-three-trading-strategy-time-price-theory",32,1789775928]