Not sure if this has been mentioned, but I have to run my AHK script as administrator (eg: right click on the AHK file and choose run as administrator). BMP files tend to work the best for me. Check my script, I had some code in there to stop spamming the buy button by forcing it to wait x seconds before another "buy" press was allowed.@Svanoy @Kevin N I'm not sure what is wrong. when I start the script nothing happens. I have one of my labels green to signal a buy but it does nothing. no mouse movement or key strokes.. I have tried to mess with a few things but still no luck. i am using SciTE for my autohotkey. I tried changing my image files to .tiff, i tried to run SciTE and autohotkey in admin mode, removed the delays, etc
Code:#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance [Forced] CoordMode, Pixel, Screen ;Key Combo to start script ;windows + s key ^9:: ^0:: Pause Loop{ ;Watch for Buy Signal ImageSearch, FoundX, FoundY, 25, 226, 239, 272, *w24 *h24 C:\Users\Home\Desktop\AutoHotKey Images\BuyLabel.png ;If found click mouse on random screen location, send ctrl + f key combo, send ctrl + b key combo. If (ErrorLevel = 0) { MouseClick, Left, 1747, 248, 1, 0 delay = 10 Send ^{f} delay = 10 Send ^{b} } ;If not found do nothing Else If (ErrorLevel = 1) { } ;Watch for Sell Signal ImageSearch, FoundX, FoundY, 25, 226, 239, 272, *w24 *h24 C:\Users\Home\Desktop\AutoHotKey Images\SellLabel.png ;If found click mouse on random screen location, send ctrl + f key combo, send ctrl + s key combo. If (ErrorLevel = 0) { MouseClick, Left, 1747, 248, 1, 0 delay = 10 Send ^{f} delay = 10 Send ^{s} } ;If not found do nothing Else If (ErrorLevel = 1) { } }Return
Then put a third Image Search in to find the white label and reset the buy sell variables in the script when found.I need the code to reset when it sees a white label
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Outside Auto-Trading Solutions for Thinkorswim | Playground | 4 | ||
P | Auto entering password | Playground | 0 | |
R | ToS Trade Button script? | Playground | 5 | |
M | Trade Algo | Playground | 2 | |
M | Daily Watchlist of Stocks to Day Trade Weekly Options For ThinkOrSwim | Playground | 999 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.