Help with calculations? (Calculations not working) | Bitcoin Trading Macro | | (v10.0.2)

...and I've tried every combination of: ,%,local,instance,etc. to no avail. I'm trying solutions I’d already written off. I don’t know what it is about this macro in particular that is proving to be far more challenging to finish than I anticipated (measuring in weeks now).

I am trying to work this algorithm "Wick Licker" out in Keyboard Maestro in addition to a few other functions such as canceling the current order and setting a stop-loss before submitting a replacement order at a different price if the current price has moved more or less than x% from a given distance (in $) from the current order.

The plan is to develop a proof of concept in Keyboard Maestro I will later replicate with Python and run endlessly on a cloud server.

If any %Variable%User% can lend a hand beyond this single calculation, I would be very grateful. I’ve been going the “learn python” route for about a month and so far have authenticated with the site’s ( API and had it successfully return a CSV. So, while I might not be entirely clueless regarding Python and programming in general, I have no idea how to interact with that data in any meaningful way.

Should this little trading bot project turn out to be successful, I would be more than happy to donate a portion of the (initial) :slight_smile: Bitcoin yielded to meaningful contributors to get them started in case they want to run the bot themselves.

I have Discord currently for screensharing or audio/video chat. Open to installing remote desktop/collaboration software if it would help significantly (and I think it may cause I’m no dumby :stuck_out_tongue_winking_eye: with MacOS and Keyboard Maestro;) just some fundamental misunderstandings that repeated readings of the wiki entries are not addressing.

Probably gonna repost on the Keyboard Maestro subreddit.

  • Desperate

Wick Licker_201.kmmacros (31 KB)

Hey man,
Your gonna wanna change your approach to clearing your variables cos as you scale up your macros, there will be alot of scrolling and expanding to a name a few which is tedious and annoying.
Ive illustrated my solution and yours in blue to compare how much screen real-estate yours take up and how much smaller mine is.
Even with mine expanded, it takes up less screen real-estate.

If your going to edit the code and you dont have much experience, ALWAYS paste it into something like VSCode that instantly scan the code to any if there are any syntax errors as Javascript for Automation action does not provide that kind of support.

Keyboard Maestro Actions.kmactions (2.9 KB)

Cool, thanks! You think clearing my variables this way will make a difference with my calculations’ execution?

Gonna switch to the :computer: and try ‘er out. :call_me_hand::partying_face::call_me_hand:

There’s a KM plugin for setting the values of multiple variables concisely. See

(Sorry @Jack_Bravo - this doesn’t address your original question.)

(Although the calculations can simplified – the long run-value of any crypto instrument is inevitably and always zero)