We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source: https://github.com/openai/evals/blob/main/docs/custom-eval.md as well as the new functions and function_call as per OpenAI's recent announcement.
functions
function_call
try: candles = self.get_oanda_candles(instrument, from_time, granularity, price) if not candles: return "Failed to fetch candles." candles_percentage = self.determine_candles_to_analyze(granularity) num_candles = int(len(candles) * candles_percentage) last_candles = candles[-num_candles:] closing_prices = np.array([float(candle['mid']['c']) for candle in last_candles]) sma_periods = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 25, 30, 40, 50, 100, 200] smas = {} for period in sma_periods: sma = np.mean(closing_prices[-period:]) smas[period] = sma trailing_sma_average = np.mean(list(smas.values())) sentiment = 'Uncertain' # Default sentiment if closing_prices[-1] > trailing_sma_average: if closing_prices[-1] - trailing_sma_average > 0.1 * trailing_sma_average: sentiment = 'Very bullish' else: sentiment = 'Bullish' elif closing_prices[-1] < trailing_sma_average: if trailing_sma_average - closing_prices[-1] > 0.1 * trailing_sma_average: sentiment = 'Very bearish' else: sentiment = 'Bearish' # Return sentiment and SMAs return {'sentiment': sentiment, 'smas': smas} except Exception as e: print(f"Error analyzing market: {e}") return {'error': str(e)}```
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Source: https://github.com/openai/evals/blob/main/docs/custom-eval.md as well as the new
functions
andfunction_call
as per OpenAI's recent announcement.The text was updated successfully, but these errors were encountered: