very new to auto trading, appreciate this might be a very basic ask. However, While AutoTrading, how do I write a piece of code that checks my account balance before placing an order?
You can’t. The amount of money in your brokers account is not data that they pass over to the PRT platform.
You can do some basic calculations in your strategy using the STRATEGYPROFIT instruction and deduct/add it to a starting capital amount to simulate this but it is not accurate because brokers fees are also data that is not passed to the PRT platform and so the effect of these is not known.