You need advice on how to calculate efficiency

Discussion in 'Automated Trading' started by faermark, Dec 21, 2024.

  1. faermark

    faermark

    Hello everyone, I’m new to algorithmic trading and need some advice.

    I deal with fairly fast trades that are executed within a few seconds to a few minutes.
    I also have a lot of statistical data, such as how the price of an asset changed over 10 seconds and whether a specific asset rose or fell.

    I’ve compiled all the statistics in Power BI, but now I’m struggling to understand how effective the algorithm performed with specific settings. Take a look at the screenshot:
    upload_2024-12-21_15-2-39.png
    1. Trigger_Delta_Sec10Relative - shows how much the asset rose or fell in percentage terms.
    2. Trade - shows how many trades were executed.
    3. ROE - this one is somewhat clear, but it’s precisely where my question lies.
    The calculation isn’t entirely accurate because of the varying order sizes.

    How should I calculate it correctly to determine that, for example, when
    Trigger_Delta_Sec10Relative = "-1.96", trades are generally unprofitable?
    Should I use winRate, or is there another metric that would be more appropriate?


    I apologize for my English, it is not my native language. I use google translate
     
  2. Sekiyo

    Sekiyo

    Guess you could simply normalize each ROE by dividing it by the number of trades ? Such as to return the average ROE per trade … or the expectancy.

    But yeah normalize each trade by the number of contracts.

    Efficiency could be … ROE / sum(ROEs).
    Better use log returns (additive).

    Or compute the deviation of each ROE away from the mean of ROEs. Such as (ROE - mean(ROEs)) / mean(ROEs)

    But … you could also compute the efficiency for each ROE such as ( sum(ROEs) / sum(abs(ROEs)) ). Use log returns (additive). This would be to compute the efficiency for each row (in isolation) but you need all the trades and their respective returns.

    Let’s say for rowX you have 3 trades [-0.4, 0.4, -0.4] … the efficiency would be ~(-0.4) / ~(1.2) = -1/3

    Let’s say for rowY you have 3 trades [0.4, -0.4, 0.4] … the efficiency would be ~(0.4) / ~(1.2) = 1/3

    The efficiency would go btw -1 (all losses) and 1 (all gains)

    Not sure on which axis you want to get the efficiency.

    Anyway it’s going to be a matter of preferences ? Unless you want to share your work and apply best practices.
     
    Last edited: Dec 21, 2024
    faermark likes this.
  3. odlareg

    odlareg

    Mmmmm, are you familiar with statistics? Personnaly I would explore the 5 trades. One of them might be a black swan.
     
  4. Sekiyo

    Sekiyo

    If we look at 1.91, 1.96 and 2.07 ... There is consistency.
    He said trades may vary in size. First normalize by size.

    Either size or he's looking for 0.4% gains and -5% loss,
    That plus size variables and it's not an outlier anymore.
     
    odlareg likes this.
  5. You are comparing different units.

    Your ROE column is the total of that block of trades. You need to break down your data into similar units.

    That ROE should represent the return per trade and size, being 1 the easiest size to compare all trades.

    So try to look for a percentage per trade of size 1 on a column and then use that metric to compare.

    Then you will have similar units.
     
  6. faermark

    faermark

    Yes, you're right.
    I have a take-profit of 0.5%
    stop-loss 5%


    This is due to the fact that the algorithm can't always enter a trade in the right price range.

    UPD:
    A little later I'll show how I decided to normalize ROE and see the stats, but I don't know if it will lead to a good result
     
  7. faermark

    faermark

    Looking at my trades in more detail, I made a table like this
    upload_2024-12-23_21-3-48.png

    I was not quite satisfied with this, so I thought it would be better to make 1 algorithm = 1 coin

    In this case I will be able to track the behavior of a particular coin in more detail, yes it will be much more complicated, but it will be better to see the correlation.
     
  8. 2rosy

    2rosy

    you could add a column ROE_hourly to standardize holding time
     
    Sekiyo and faermark like this.
  9. faermark

    faermark

    I have analyzed most of the ones that closed in the negative, and almost all of them occur in this case:
    The algorithm has entered the trade, and has been in the trade for 2-5-10-15... minutes (which is not very good. I like when a trade closes within 20-30 seconds, I need to see how I can customize that too).
    At this moment bitcoin starts to fall sharply, and several already open trades are closed in minus accordingly.

    How I'm thinking of doing it:
    Take the stats for the 1 coin with the most trades, and see how the stats differ between being in a trade for a super short period of time, and being in a trade for a few minutes or even hours
     
    Sekiyo likes this.