Update: This post has been updated to reflect changes in newer versions. As of this update, the latest version is 1.3.2.





Profitability Mining is mining whatever crypto-coin is most p

rofitable at any given time based on how much it is worth in Bitcoins. This is not a new concept and has been in practice since the first alt-coin appeared. I did not come up with the idea, I just made it easier to do in CGWatcher. I realize Profitability Mining may not be the best name for it, as even mining one coin is done in hopes of being profitable. But I have to refer to it as something other than "switching coins often based on current profitability at the time of the switch".





1.2.0 introduced profitability mining, the second most requested feature behind CGRemote (in beta). This post will explain how this works, and how the Scheduled Actions used to control profitability mining work.









Scheduled Actions

The previous scheduling feature in CGWatcher provided a basic "start miner" and "stop miner" option, and meant that the scheduled mining would have to occur on the set days at the set times every week. I didn't want to just duplicate this feature a few times, and instead wanted to allow for unlimited control of scheduling the miner to perform a variety of actions. I think the Scheduled Actions (similar to Window's Scheduled Tasks but named differently to avoid confusion) provide that and allow for additional actions to be easily added in the future. They allow you to fine-tune what your miner does and when it does it, down to the exact second.





The Scheduled Actions you create are displayed in the Schedule tab. They are sorted to display all enabled actions first, in chronological order of when they will next run. Disabled actions are displayed last.





List of Scheduled Actions









Each action has an enable/disable checkbox, Edit button, and Delete button. Click Add Scheduled Action... to create a new action.





The actions available as of version 1.3.2:

Start Mining

Stop Mining

Restart Mining

Restart Computer

Change Intensity

Change All Intensities

Switch Profile

Enable Device

Disable Device

Restart Device

Run Program

Send API Commands to Miner

Send E-Mail





Creating a scheduled action is as easy as building a sentence.









Along with switching to a specific profile, you can switch to the next profile (rotation) or have CGWatcher choose a profile based on profitability when the action is triggered.



When creating a scheduled action, think of creating a sentence instructing CGWatcher of what you want it to do. As you select one option, other available options may be changed or filtered.





After selecting an action, one or more "value" options may appear under it depending on which action you selected. For the Change Intensity action, this is the GPU and intensity you want to change to. For the Switch Profile action, a drop-down list of your profiles allows you to select which profile to switch to. There are some additional options at the bottom of this list related to profitability, which I'll go into more below.





Next in the sentence are the frequency options. You can choose to have the action run daily, on a specific day, weekdays, weekends, or at set intervals (you can use decimals in the interval to specify less than one hour). You can also choose to have the action triggered by an event - the computer becoming idle, a specific program starts running, or a wide variety of mining and coin-based events. Similar to actions, certain frequencies may have additional options that appear underneath when selected.





You can create scheduled actions that run at the exact same time, but if you want to ensure one runs before another you should add at least one second to the one you want to run last because they are ran in order of the time you set. If you schedule a Start Mining action to run at 3:00:00 PM and a Change Intensity action to run at 3:00:01 PM, the Change Intensity action will run once the Start Mining action has completed (which takes more than one second), so you do not have to worry about timing actions depending on what they do.



In addition to setting a time to trigger the action, in many cases you can set a stop time. When the stop time is reached, CGWatcher reverts the miner back to the settings that were in use before the action was triggered.





When using Every... N hour(s) actions, the timer for each of these actions begins when CGWatcher is started. So creating an action to run every 4 hours would run first 4 hours after CGWatcher was started. Then it will run 4 hours after that, and so on. However, if you either edit an action or enable a disabled action, the timer's start time is reset.



Addition options:



Start the miner for this action if it is not already running - this option is available for certain types of actions. If this option is enabled and the action causes the miner to be started, setting a stop time means the miner will be stopped when the stop time is reached.



Persist through miner restarts until stopped by user or stop time - when miner restarts occur can be unpredictable depending on the monitoring options you use. If a scheduled action to increase intensities occurs and shortly after, for example, the hashrate drops and CGWatcher is set to restart the miner when this occurs, you may still want those increased intensities applied after the miner is restarted. This option allows for that, and will continue to re-apply the action after the miner is restarted until either the user stops the miner (by clicking the Stop button) or the action's stop time is reached (if one is set).



Run this action once (action is deleted after running) - will delete the action immediately after running it.





If you move your mouse over a scheduled action in the Schedule tab of CGWatcher's main window, a tooltip will display the next time that action is set to run. (This only applies to enabled actions.)









Profitability Mining





So when using CGWatcher, profitability mining is using scheduled actions to automatically switch to mine the most profitable coin that you've setup to mine. It works by checking the current profitability of the various crypto-coins, and then switching to the profile with the most profitable coin (or whichever field you want it to base this decision on). This means that you'll want to create a separate profile for each coin that you mine, and assign a coin to each profile in Profile Manager. If you do not assign a coin to a profile, the profile is ignored when determining which profile is most profitable.





Profile Manager window





The Profile Manager now includes a drop-down list to select the coin to associate to that profile. The coin data is collected from http://www.coinchoose.com, so new coins added to the website will become available in CGWatcher after the coin data is refreshed. CGWatcher also uses the data from coinchoose to determine profile profitability. See more information on adding and removing coins manually in the Coin Manager section below.





You'll need to assign a coin to at least two profiles in order for profitability mining to work. Otherwise if you did not assign a coin to any profiles, it would be unable to determine which is most profitable; and if you assign a coin to only one profile, that profile would always be the most profitable because there is nothing else to compare it to.





You can check profitability at any time by clicking an Other Tools... button and then selecting Coin Profitability from the menu. There is also a Profitability button in the Settings tab. These open the Coin Profitability window, which displays current profitability data from CoinChoose, along with some other information about each coin like hashing algorithm, difficulty, network hashrate, best price, and which exchange is currently offering the best price. You can create scheduled actions based on any of the numeric fields in this window, as well as the rank (e.g. 2nd most profitable, or 1st lowest difficulty, or 3rd highest reward, etc.) You can also create your own custom field that uses a mathematical expression you create to set its values. This allows you to create your own profitability formula using the other field values and common mathematical functions and operators (more information below).





Coin Profitability window





In the Coin Profitability window, you can sort columns by clicking on the column header cell once to sort ascending, then again to sort descending.



Coin profitability can be based on Bitcoin (default) or Litecoin. If you mine a coin at 300% profitability of Bitcoin, you should, in theory, be able to convert those mined coins to 3x the Bitcoins you would have earned if you had mined Bitcoins. You can change this any time in Coin Manager's Settings tab. For the next section, we'll assume you've selected profitability based on Bitcoin.





There are three columns relating to the coin profitability. The first, "Profitability", is the current profitability compared to Bitcoin. If profitability is 200%, mining that coin will earn you twice as many Bitcoins as mining Bitcoin itself (once you exchange the coin to Bitcoins). Obviously this value can change at any time, and you would need to convert the mined coins to Bitcoin immediately in order to preserve this increase. If you hold the coin and decide to convert to Bitcoins the next day when the coin's profitability may be at only 50%, you've now lost the additional coins you made by profitability mining. Likewise, there is the possibility that holding the coins allows you to convert when the profitability is even higher, so it is a gamble. Yes, there are miners who are not interested in converting everything to Bitcoin. But that is an essential part of profitability mining, since all profitability is based on Bitcoin (or Litecoin).





The second column is "Adjusted Profitability". This value has been adjusted for stales and is intended to give a more accurate estimate of profitability.





The third column is "Average Profitability", which is based on a 7-day average. This is useful if you are looking to mine something more continuously instead of jumping on whatever happens to be most profitable every couple hours.



The other numeric data columns like "reward", "difficulty", and "network hashrate" can also be used. If you're interested in just mining as many coins as possible, you can create a custom formula using reward, difficulty, and network hashrate together to determine which coin you can mine the most of. Then hold the mined coins until that coin is the speculators' coin-of-the-day and increases in value.



If you created your own custom profitability formula, you'll also see a 'Custom' field displayed in this window showing the value for each coin - calculated using the mathematical expression you created.





So back in the Scheduled Action window, you'll see that if you select the Switch Profile action, there are several profitability options in the profiles drop-down list matching the columns in the Coin Profitability window. Selecting one of these tells CGWatcher which profitability value you want it to use when determining which profile of yours is most profitable before switching to that profile.





By default, CGWatcher updates coin profitability data every 15 minutes. You can change this in Coin Manager's Settings tab. The minimum value is 5 minutes, and the maximum is 1380 (or 23 hours). When a scheduled action is triggered that switches profiles to most profitable, CGWatcher checks if the coin data has been refreshed in the past minute, and if it hasn't, it attempts to refresh it to ensure it is selecting the profile based on updated data. If that refresh should fail and CGWatcher finds that the coin profitability data has not been updated in the past 24 hours, it cancels the action (which is why the maximum refresh interval is 23 hours.)





Some example scheduled actions:





[ Switch Profile ] to [ {Most Profitable} ] [ Every... ] [ 8 ] hour(s)





[ Switch Profile ] to [ {Most Profitable - adjusted} ] [ Weekdays ] at [ 8:00:00 AM ]





[ Switch Profile ] to [ {Highest custom field value} ] [ Daily ] at [ 5:00:00 PM ]



[ Switch Profile ] to [ {Lowest difficulty} ] [ when event occurs... ] [ 0Profiles - Lowest difficulty changes ] (*This is checked each time coin data is updated, default: every 15 minutes)





[

] [

] [

Weekdays

] at [

10:00:00 PM

]





[

] [

] [

Daily

] at [

4:00:00 PM

]





[

] [

] [

Monday

] at [

4

:00:00 AM

]





[

] to [

12

] [

when computer is idle for at least

] [

10 minutes

]





[

] [

GPU0

] [

when program is running

] named [

C:\Games\BattleField 2\BF2.exe

]





[

] to [

myemail@email.com

] [

when event occurs...

] [

Current pool goes down

]



[ Run program ] to [ 12 ] named [ C:\Program Files\TeamViewer\TeamViewer.exe ] when [ program is not running ] named [ C:\Program Files\TeamViewer\TeamViewer.exe ] (this would make sure TeamViewer is restarted if it crashes)



