Code Monkey home page Code Monkey logo

aiomql's Introduction

  • 👋 Hi, I’m Ichinga Samuel
  • 👀 I’m interested in building awesome software💪
  • 📫 How to reach me [email protected]

aiomql's People

Contributors

ichinga-samuel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aiomql's Issues

import error

I have an error

No Config File Found
Traceback (most recent call last):
File "C:\bot\example.py", line 1, in
from lib.strategies.finger_trap import FingerTrap
File "C:\bot\lib_init_.py", line 1, in
from .strategies.finger_trap import FingerTrap
File "C:\bot\lib\strategies\finger_trap.py", line 5, in
from ..traders.simple_deal_trader import DealTrader
File "C:\bot\lib\traders\simple_deal_trader.py", line 4, in
from aiomql.utils import dict_to_string
File "C:\Users\AS\miniconda3\lib\site-packages\aiomql_init_.py", line 3, in
from .strategy import Strategy
File "C:\Users\AS\miniconda3\lib\site-packages\aiomql\strategy.py", line 10, in
from .candle import Candles, Candle
File "C:\Users\AS\miniconda3\lib\site-packages\aiomql\candle.py", line 2, in
from typing import Type, TypeVar, Generic, Self
ImportError: cannot import name 'Self' from 'typing' (C:\Users\AS\miniconda3\lib\typing.py)

and I fix it to remove Self from candle.py line 2

error

hey my friend, I ran this code and that had error

def build_bot():
    bot = Bot()
    st = FingerTrap(symbol=ForexSymbol(name='EURUSD'))
    st1 = FingerTrap(symbol=ForexSymbol(name='GBPUSD'))
    st3 = FingerTrap(symbol=ForexSymbol(name='EURGBP'))
    st4 = FingerTrap(symbol=ForexSymbol(name='EURAUD'))
    bot.add_strategies([st1, st, st3, st4])
    bot.execute()


build_bot()

error :

No Config File Found
No Config File Found
No Config File Found
No Config File Found
EURGBP not a available for this market
EURAUD not a available for this market
EURUSD not a available for this market
GBPUSD not a available for this market
Trading EURUSD
Trading EURAUD
'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend
'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend
'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend
'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend
'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend
'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend
'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend
'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend

TradeResult

hey friend
I think that you remove TradeResult
but in file /src/aiomql/lib/traders/simple_deal_trader.py
you use it

from .trade_result import TradeResult

 
 result.profit = await self.order.calc_profit()
 await TradeResult(result=result, parameters=params).save()      #line 60

Optimization and Structural Enhancement of Trading System

I have reviewed the system structure. You have built almost all the features to handle the MT5 API integration smoothly and optimally. However, there are still some areas that can be optimized further:

  1. Symbol Buffer Optimization

    • The copy_rates_* functions should store the previously updated data and only update the missing candles from the last update time.
    • Similarly, for copy_ticks_*.
  2. Trading Strategy Execution Structure

    • A basic abstract base class (ABC) singleton (Symbol, Magic) should be created to define the structure of campaign components more flexibly. This should include:
      • DataProcessing: Handling updates of rates, indicator calculations, signal detection, etc.
      • Events:
        • OnTick: Listening for tick changes.
        • OnSignal
        • OnTarget
      • Analytics:
        • Deals, Reports (Alerts, to_pdf, to_xsl, etc.)
        • Orders
        • Positions
  3. Backtesting Integration

    • It would be excellent if we could add backtesting functionality.
    • MT5 integration does not support backtesting directly. We can only use copy_ticks_* if we want to backtest with real ticks, or use the M1 timeframe and resample it into higher timeframes to backtest across multiple timeframes simultaneously.
    • Additionally, we need to build an order simulation to track the backtest process when orders are filled or targets are hit, etc.
    • Finally, we must report on our strategy.

Benefits

Implementing these optimizations and structural enhancements will:

  • Improve the efficiency of data updates by reducing redundant data fetching.
  • Provide a flexible and extensible framework for defining and executing trading strategies.
  • Facilitate better organization and separation of concerns within the system.
  • Enable comprehensive backtesting of strategies, providing valuable insights into their performance before live trading.

Suggested Implementation Steps

  1. Modify the copy_rates_* functions to check and store the last updated data and only fetch new candles since the last update.
  2. Apply a similar approach to the copy_ticks_* functions.
  3. Design and implement a basic ABC singleton class for trading strategies, encapsulating the suggested components (DataProcessing, Events, Analytics).
  4. Develop a backtesting module:
    • Implement tick data handling and M1 timeframe resampling for multi-timeframe backtesting.
    • Create an order simulation mechanism to track order fills and target hits during the backtest.
    • Generate comprehensive reports on strategy performance.

Your contributions have been very useful and appreciated. Looking forward to further improvements and discussions, especially regarding the backtesting implementation. 1+)

backtest

do you have backtest in your framwork?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.