Lavoro terminato
Specifiche
Hi,
I’d like to make a day trading algorithm that bases buy/sell decisions on a set of financial indicators and the average price of an instrument. Weighted averages will be used to combine multiple variables and inform buy or sell decision.
Firstly, the algorithm needs to record the weekly price range. This can be done by recording the highest and lowest values during the week prior to current price in a given time interval (1-5 sec). Percentiles are then assigned to the values in-between, with the top value being the highest (100th) percentile and the lowest value being the lowest percentile (1st). Current price is then allocated to a percentile and given a value from 0.01 (if in 100th percentile) to 1 (if in 1st percentile). Let’s call this value A.
Similarly, the algorithm then records the top and bottom price values for the day prior to current price in a given time interval (1-5 sec). The current price is allocated a percentile and given a value between 0.01 (if in top percentile) and 1 (if in bottom percentile) . Let’s call this value B.
Then, the sales volume for the current interval is given as a ratio to the highest sales volume for a given time interval in the week preceding the current interval (i.e current sales volume / highest sales volume for given interval during the week prior to current interval). This value is given as C.
Then the algorithm records the CCI (commodity channel index) value and if it is above 100, then the algorithm places a sell order regardless of weekly and daily percentile values. If it is below -100 then the algorithm automatically places a buy order regardless of weekly and daily percentile orders. Alternatively, if the price is above 100, this variable is assigned the value 0.1; if it is below -100 it is the given 1. Let’s call this value D. The user needs to have the option of whether to include CCI in the calculation, assign it a value from 0.1 to 1, or not include it at all.
Then the algorithm gives the value for (VWAP/Price). Lets’s call this value E.
Finally, if MACD crosses then the algorithm needs to buy against trend. The value of 0.75 is assigned if trend reversal projection means buy, and the value of 0.25 is assigned if the trend reversal projection means sell. If the algorithm identifies a bullish trend based on the previous 5 or 10 values and records that MACD line crosses then the algorithm will assign the value of 0.25; if the previous 5 or 10 values (this can be modified by the user) show a bearish trend then the algorithm will assign the value 0.75 . Let’s call this value M.
If possible, the algorithm will use the daily projections from professional websites to inform likely intraday price range. It would be helpful if you have access to reliable projection data. If not, just use the data from websites like tradingview, fxempire etc. If the daily projection is higher than current price then assign value 1. If the daily projection is lower than current price then assign value 0.1. This value can be called X.
In order to calculate the final buy/sell decision the program will use weighted averages to combine the above variables. Here is an example of the formula using weighted averages: [(0.2*A)+(0.4*B)+(0.1*C)+(0.1*E)+(0.1*M)+(0.1*X)]/6. The result will then determine the buy or sell decision: if the value is below 0.5 then the algorithm will sell, if the value is above 0.5 then the algorithm will buy. The user needs to be able to choose weighted average values for each variable and set that prior to the start of the program. The user will also need to set the threshold for buy/sell decision. The algorithm will execute these transactions without confirming with the user. However every transaction needs to show the resulting value upon which it based its buy or sell decision.
All transactions will have a set profit/loss limits. These will be set based on the percentage of the daily volatility. This can be calculated from subtracting the bottom value for the day prior to current time from the top value. The user is then able to set the percentage of this volatility as profit/loss limits.
The program needs to show balance, equity, margin levels, order lists and the proportion of orders that closed with profit to those closed with loss.
The aim of the algorithm is to amalgamate multiple variables into a mathematical value that reflects the likelihood of bullish or bearish trend given by the individual variables. This likelihood is based on the idea that prices that are relatively above the average price level are more likely to be bearish and vice versa , while taking into account the predictions given by select financial indicators.
The user needs to be able to set the time interval for transaction frequency, ranging from the smallest available interval to every few hours.
The algorithm will continuously update data (e.g. percentile data based on preceding week’s values) as time goes on.
I hope this makes sense. I look forward to working with you.