Closed adammorley closed 4 years ago
when running the init EMA calcuiations, also check the same buy checks pass. if they pass anytime in the interval and stay crossed up until now, take the buy price and if the current market price is near that price, safe to enter a buy order.
so this is only useful if there is an initial "soft" period when we just started up. it's a nice to have.
moved to 5 second data, much more granular and hence this doesn't really work to enter when it's crossed. would need a strong indicator on directionality w/o crossover.
if just started and the EMA crossed in the last longInterval, and meets the buy criteria from the crossover point, buy it. if script just started and the EMA crossed in the interval prior and it looks "legit," and the prices are in the bands where the code would've entered, go ahead and enter a position. want to know if stateChanged during init EMA calculations in detector and if the buy value at the watchCount point is still valid. so would re-factor checkForBuy to recalc if not an init calc. hmm. stateChange is only tracked during buy decision tracking. this would need back testing to validate, because the entry point/price might be "soft" from a momentum detection perspective.