Table of Contents
Trade Formula
Trade Formula – This formula calculates each trader's priority. Higher priority means more traffic. Traders are ranked using these parameters:
TOTAL_OWED total debt 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
TOTAL_OWED*0.2 + HOUR_OWED*0.2 + HOUR_HITS*0 + HOUR_TRADE_PROD*0+ HOUR_PROD*0 + TOTAL_HITS*0 + TOTAL_TRADE_PROD*0.2+ TOTAL_PROD*0 + TOTAL_OUT2CLICK*0 + HOUR_OUT2CLICK*0 + TOTAL_RELOWN*0.4 + HOUR_RELOWN*0
The order of numbers doesn't matter, you can safely multiply by 100, 1000 or 100000 - the result will be the same, what matters is the ratio between the parameter weights. 0.2 and so on is only made for convenience of perception - i.e. the sum of all weights = 1. If we change some parameter from 0.1 to 0.2 - this means we increase its weight by 10%.
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
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't they put it directly in the script? Why write in the wiki and make the formula open in the settings?
Formula Limits
Since the formula itself assumes some calculations, there are 2 options for their calculation.
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, only +- */
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['allow_eval'] = true;
and then you can use any PHP code in the formula.
By default in the trade formula you can only use
$config['allow_eval'] = true;
With this parameter you can use Formulas suggested by users
Fett http://smartcj.com/forum/viewtopic.php?f=2&t=93113&start=20 1; $_POST[priority] = @round( (((($d['day']['cd']/$d['day']['od'])*100)*0.7) + ((($d['day']['ud']/$d['day']['rd'])*100)*0.3)) + ( (((($d['day']['rd']-$d['day']['od'])/$d['day']['rd'])*100)*0.25) + ((($d['day']['rd']/$d['day']['od'])*100)*0.75) ) );
Simple option
$_POST[priority] = @round( ($d['day']['ctd']+$d['day']['cud'])/$d['day']['od']* $d['trat'] / 100);
User formulas
$_POST[priority] = round ( (( ( ($d['day']['thishourct']+$d['day']['thishourcu'])/($d['day']['thishouro']+1)*100)/3) +((($d['day']['ctd']+$d['day']['cud'])/($d['day']['od']+1)*100)/2)) *pow(round((($d['day']['last_click'])/($d['day']['od']+1))*100)/100,1) )
Variables for custom formulas
$d[trat] - trade ratio
$d[day] => Array
(
[rd] => rows
[ud] => uni
[od] => out
[cd] => clicks daily
[ctd] => clicks trade daily
[cud] => clicks url daily
[quality] => quality to trade (prod using quality settings)
[quality_url] => quality to url(prod using quality settings)
[pr] => in prozy count
[pr_out] => out proxy count
[ch] => cheat
[ncd] => next click count
[last_click] => last click count
[thishouru] => this hour row
[thishourr] => this hour uni
[thishouro] => this hour out
[thishourct] => this hour click trade
[thishourcu] => this hour click url
[thishourcq] => this hour quality
[thishourcq_url] => this hour quality url
[thishournc] => this hour next click
)
[prod] => Array
(
[hour_trade] => prod to trade
[hour_total] =>
[day_trade] =>
[day_total] =>
[hour_out2click] =>
[day_out2click] =>
)
