implemention of #311 tix api liquidation error fix#313
Open
samohtGTO wants to merge 3 commits intoalainbryden:mainfrom
Open
implemention of #311 tix api liquidation error fix#313samohtGTO wants to merge 3 commits intoalainbryden:mainfrom
samohtGTO wants to merge 3 commits intoalainbryden:mainfrom
Conversation
Author
|
we might want to tweak some values that will allow it thru but i dont know what is usefull to when to let it thru or not. |
alainbryden
reviewed
Oct 2, 2024
| const hasTixApiAccess = await getNsDataThroughFile(ns, 'ns.stock.hasTIXAPIAccess()'); | ||
| if(!hasTixApiAccess) { | ||
| return false; //We cant liquidate | ||
| } |
Owner
There was a problem hiding this comment.
This may be a bit aggressive - for example if we don't have TIXAPIAccess, but the user also just doesn't have any stocks, then we should be able to ascend normally because there's no fear of leaving stocks unsold / money unspent.
I think there's a separate API method that checks if we even have access to the stock market, so this could instead be something like:
if( hasStockMarketAccess && !hasTixApiAccess )
setStatus(ns, `You have access to the stock market, but not the stock API! We will not ascend automatically, just in case you have some stock to sell...`);
return false;
Also, the indentation is off here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fix to that we cant liquedate stock when whe have no tix api so autopilot wont ascend.