trade_formula
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| trade_formula [2017/03/10 15:22] – admin | trade_formula [2026/03/21 10:12] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Trade Formula ====== | ====== Trade Formula ====== | ||
| - | |||
| - | Trade Formula – a formula used by script to calculate priority of each trade. Higher priority means more hits to this trader. Simplified view is presented by classic formula | ||
| - | | + | **Trade Formula** – This formula calculates each trader' |
| - | HOUR_OWED*0.3 + | + | TOTAL_OWED total debt |
| - | HOUR_HITS*0 + | + | HOUR_OWED hourly debt |
| + | HOUR_HITS number of hits per hour | ||
| + | HOUR_PROD hourly productivity | ||
| + | TOTAL_HITS total number of hits | ||
| + | TOTAL_PROD total productivity | ||
| + | TOTAL_OUT2CLICK total ratio of outs to clicks | ||
| + | HOUR_OUT2CLICK – hourly ratio of outs to clicks | ||
| + | TOTAL_RELOWN total debt relative to trade value, i.e. if we owe 10 for a 10k trade that's not as bad as owing 10 for a 50 hit trade. | ||
| + | HOUR_RELOWN hourly relative debt | ||
| + | |||
| + | When calculating priority each of these parameters is taken into account to a certain degree, some parameters are more important to us, some are less important. The formula shows which parameter the script should weight more heavily. If you don't understand something in this formula, it's better not to change anything. | ||
| + | |||
| + | |||
| + | Classical | ||
| + | |||
| + | | ||
| + | HOUR_OWED*0.2 + | ||
| + | HOUR_HITS*0 + | ||
| HOUR_TRADE_PROD*0+ | HOUR_TRADE_PROD*0+ | ||
| - | HOUR_PROD*0 + | + | HOUR_PROD*0 + |
| - | TOTAL_HITS*0 + | + | TOTAL_HITS*0 + |
| - | TOTAL_TRADE_PROD*0+ | + | TOTAL_TRADE_PROD*0.2+ |
| TOTAL_PROD*0 + | TOTAL_PROD*0 + | ||
| - | TOTAL_OUT2CLICK*0 + | + | TOTAL_OUT2CLICK*0 + |
| - | HOUR_OUT2CLICK*0 + | + | HOUR_OUT2CLICK*0 + |
| - | TOTAL_RELOWN*0.6 + | + | TOTAL_RELOWN*0.4 + |
| - | HOUR_RELOWN*0 | + | HOUR_RELOWN*0 |
| - | 0.3, 0.6 and so are weight parameters that define impotance | + | The order of numbers doesn' |
| - | Here is some formulas offered by our users: | ||
| - | 1; $_POST[priority] = @round( ($d[' | ||
| + | The awm_mark formula | ||
| + | < | ||
| + | TOTAL_OWED*0 + | ||
| + | HOUR_OWED*0 + | ||
| + | HOUR_HITS*1 + | ||
| + | HOUR_TRADE_PROD*0 + | ||
| + | HOUR_PROD*1 + | ||
| + | TOTAL_HITS*9 + | ||
| + | TOTAL_TRADE_PROD*3 + | ||
| + | TOTAL_PROD*1 + | ||
| + | TOTAL_OUT2CLICK*0 + | ||
| + | HOUR_OUT2CLICK*0 + | ||
| + | TOTAL_RELOWN*5 + | ||
| + | HOUR_RELOWN*0 | ||
| + | </ | ||
| - | @round( ($d[' | ||
| - | 1; $_POST[priority] = round ( (( ( ($d[' | ||
| - | +((($d[' | ||
| - | *pow(round((($d[' | ||
| + | ===== Which formula is better ===== | ||
| + | |||
| + | If some concrete formula was better than all others and worked in all cases, and this was known for sure - why wouldn' | ||
| + | |||
| + | |||
| + | ===== Formula Limits ===== | ||
| + | |||
| + | Since the formula itself assumes some calculations, | ||
| + | |||
| + | 1. When the script parses the formula and tries to figure out + - and so on by itself. | ||
| + | |||
| + | 2. When the script does eval - this is when your code is executed directly by PHP. | ||
| + | |||
| + | Option 1 is used by default because it's safer. However it can't do complex calculations, | ||
| + | |||
| + | Option 2 can do everything PHP can do, however it's less secure. | ||
| + | The thing is that cron runs as a user, so in option 2 all code that you can enter in the admin will be executed as that user. | ||
| + | |||
| + | So in option 2 if someone gets into the admin or can write to the database on your server - they can effectively execute anything on the server as that user. | ||
| + | |||
| + | To enable this option you need to add to config.php | ||
| + | |||
| + | $config[' | ||
| + | |||
| + | and then you can use any PHP code in the formula. | ||
| + | |||
| + | |||
| + | |||
| + | By default in the trade formula you can only use | ||
| + | |||
| + | $config[' | ||
| + | |||
| + | |||
| + | With this parameter you can use Formulas suggested by users | ||
| + | |||
| + | < | ||
| + | |||
| + | Fett | ||
| + | http:// | ||
| + | |||
| + | 1; $_POST[priority] = @round( (((($d[' | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | Simple option | ||
| + | < | ||
| + | $_POST[priority] = @round( ($d[' | ||
| + | </ | ||
| + | |||
| + | |||
| + | User formulas | ||
| + | |||
| + | < | ||
| + | $_POST[priority] = round ( (( ( ($d[' | ||
| + | +((($d[' | ||
| + | *pow(round((($d[' | ||
| + | </ | ||
| - | 1; if ( ( ( ($d[' | ||
| - | + (( ($d[' | ||
| - | | ||
| - | } else { | ||
| - | | ||
| - | | ||
| - | } | ||
| - | Varibles | + | Variables for custom formulas |
| < | < | ||
| Line 76: | Line 153: | ||
| [prod] => Array | [prod] => Array | ||
| ( | ( | ||
| - | [hour_trade] => prod to trade | + | [hour_trade] => prod to trade |
| - | [hour_total] => | + | [hour_total] => |
| - | [day_trade] => | + | [day_trade] => |
| - | [day_total] => | + | [day_total] => |
| - | [hour_out2click] => | + | [hour_out2click] => |
| - | [day_out2click] => | + | [day_out2click] => |
| ) | ) | ||
trade_formula.1489159371.txt.gz · Last modified: (external edit)
