Pages:
Author

Topic: Qt Bitcoin Trader - Dedicated rule configuration thread (Read 8086 times)

newbie
Activity: 26
Merit: 0
Can it be configured such that if I set "If last price goes down 2% than.." (without trailing checkbox), and it sold all my coins, then if that executed, I want it to buy back at a lower price (i.e. within a certain period of time [this might be optional] and it starts to go back up by a fixed/percentage amount)? How would I go about doing that?

This is basically to sell all my coins while it is dropping and buying back when it has reached it lowest. Idea here is to gain more coins.

Also, because it usually drop down fast such that even if we place an order, it might still be above what others are paying, so is it possible to configure it to sell at what others are selling AND also take off $x amount to guarantee a sell?

Note: I have not use any trading programs before.
newbie
Activity: 10
Merit: 0

PM Sent.

legendary
Activity: 1035
Merit: 1065

Same error. I am using Win 7 64 bit if that matters.

Tested on few Windows versions, it does works for me.
Please pm me and provide TeamViewer access if possible.
newbie
Activity: 10
Merit: 0

Same error. I am using Win 7 64 bit if that matters.
legendary
Activity: 1035
Merit: 1065

Thanks for the example.

When trying to update the first Bugfix #1 I got message "Download error. Please try again. Unknown error. CODE: 1" and "Download error. Please try again. Unknown error. CODE: 9"

Tying again did not fix the error.

Maybe GitHub mirrors still updating. Let me know if this issue continue apears at one hour.

PS: Every update I check within 5 minutes after published. And I test updating from older versions for Mac and Win.
newbie
Activity: 10
Merit: 0

Thanks for the example.

When trying to update the first Bugfix #1 I got message "Download error. Please try again. Unknown error. CODE: 1" and "Download error. Please try again. Unknown error. CODE: 9"

Tying again did not fix the error.

legendary
Activity: 1035
Merit: 1065

Could someone explain "Trailing Value" in the updated Rules when using % at Ver. 1.07.97?

For example you set "If last price goes down 2% (trailing) than.."
Current price is 1000, and rule should execute at 980.
But if price goes up 1100 first, than rule will be executed at 1078.

If you set "If last price goes down 2% than.." (without trailing checkbox) than rule will be executed only at 980, even price goes 110 first.

Also now you can set to sell 86% of your balance etc..

Also now you can set rule "If last price more or less by 10$ than play beep". So you will hear beep every 10$ price change.
newbie
Activity: 10
Merit: 0

Could someone explain "Trailing Value" in the updated Rules when using % at Ver. 1.07.97?



newbie
Activity: 10
Merit: 0
For my surprise trade "Group 2" was made like it should, but the Qt Trader did not show it to me when the program was running.

Does anyone else have the same problem and why this happens?

What did I set up wrong since the rule "Group 2" sold all my BTC but "Group 3" did not protect my balance?
 

This is a bug and I have fixed it. Update will be available soon.

The "balance protection" rules in "Group 3" should only protect rules in "Group 3", not so? I would consider this the correct procedure and am using it that way, i.e, I place the protection rules in the group I want to have protection.
If this is a bug AND it is changed, I will have to change all my rules so please inform if so.

Best Regards.


That is a really good point and would be nice to know which way we should set the "balance protection" rules.
full member
Activity: 122
Merit: 100
For my surprise trade "Group 2" was made like it should, but the Qt Trader did not show it to me when the program was running.

Does anyone else have the same problem and why this happens?

What did I set up wrong since the rule "Group 2" sold all my BTC but "Group 3" did not protect my balance?
 

This is a bug and I have fixed it. Update will be available soon.

The "balance protection" rules in "Group 3" should only protect rules in "Group 3", not so? I would consider this the correct procedure and am using it that way, i.e, I place the protection rules in the group I want to have protection.
If this is a bug AND it is changed, I will have to change all my rules so please inform if so.

Best Regards.
sr. member
Activity: 450
Merit: 250
I have already made rules fixes. And now rules executing correctly. I'll publish update soon.

You can tell me about your implementation of delay, and why safe-mode delay not works for you?
I have not been able to determine why it didn't work for me. Just that when enabled, everything comes to a halt.

As for how I implemented delay, I am using a double spinbox that keeps updating its value using the following code (which is also used to test if enough time has passed or not... currently hard-coded to 16 seconds in another place, but I plan to make it configurable. I also plan to change it to use milliseconds instead of seconds, but only so I can show tenths of a second)

Code: (qtbitcointrader.h)
public:
    bool lastTradeElapsedTime();    // elapsed time since last executed trade    =squeak=
Code: (qtbitcointrader.cpp)
bool QtBitcoinTrader::lastTradeElapsedTime()    // returns pass/fail
{
    ui.lastTradeTimestamp->setValue(difftime(time(0),baseValues.oldTradeTimestamp));   // also testing delay   =squeak=

    if(ui.lastTradeTimestamp->value()<=0)   // color for pass/fail
    {
        ui.lastTradeTimestamp->setStyleSheet("QDoubleSpinBox {background: "+baseValues.appTheme.lightRed.name()+";}");
        return false;
    } else {
        ui.lastTradeTimestamp->setStyleSheet("QDoubleSpinBox {background: "+baseValues.appTheme.lightGreen.name()+";}");
        return true;
    }
}

I included a lastTradeElapsedTime(); at the beginning of QtBitcoinTrader::checkAllRules() without evaluating it, just to keep the spinbox current.

I included a test for it in RuleHolder::isAchieved(double price), in a way so it would fail if elapsed time was still negative and the rule would execute a trade, but still allow enable/disable/cancel rules to pass even if elapsed time was negative.

and finally, within RuleWidget::checkAndExecuteRule(int ruleType, double price)

near the end, after the priceToExec checks, I have this...
Code: (rulewidget.cpp)
       if(ruleBtc>=baseValues.currentPair.tradeVolumeMin&&mainWindow.lastTradeElapsedTime())
        {
            if(isBuying)mainWindow.apiBuySend(ruleBtc,priceToExec            else mainWindow.apiSellSend(ruleBtc,priceToExec            baseValues.oldTradeTimestamp=time(0)+16;   // update to current timestamp +16 seconds for lastTradeElapsedTime() delay.   =squeak=   =*= to-do: delay amount (16) make configurable
            rulesModel->setRuleStateByHolder(achievedHolderList.at(n),2);
        }
        //qDebug()<<"State"<        //rulesModel->setRuleStateByHolder(achievedHolderList.at(n),2); //trying this above instead, so it doesn't change to 'done' if trade didn't occur.  =squeak=
        if(ui.ruleBeep->isChecked())mainWindow.beep();
I realize "lastTradeTimestamp" isn't accurate in how it is used, but it was in my earlier versions... this is my dirty code in my rough-draft copy while I work out what I want to do. I'll implement it better later in my other copy eventually.

(I currently have trading by portfolio-ratio running reliably (but not elegantly) and I still have a lot to do yet.)

This was one half of the solution, just to pace the trading... setting the enabled/disabled flags on the BTC/USD balance spinboxes were the other half. in QtBitcoinTrader::apiSellSend(double btc, double price), I "emit accBtcBalanceEnabled(false);" and accUsdBalanceEnabled... and do the same in apiBuySend().

Both have matching signals.
Code:
connect(this,SIGNAL(accBtcBalanceEnable(bool)),ui.accountBTC,SLOT(setEnabled(bool)));
where needed, and updated all of the exchange*.cpp files to "emit accBtcBalanceEnabled(true);" when a new balance was received without error.

I also changed a stylesheet (I forget where, but it looked like a generic call) somewhere, which was showing disabled in same color as enabled, and now disabled is grey, and also added a light-yellow option, for when the value hasn't changed.

So now, when it tests if a rule is achieved, it tests for both lastTradeTimestamp() being true, and if the relevant balance amount's box is enabled, for a rule to be achieved.

=squeak=
legendary
Activity: 1035
Merit: 1065
Hello Ighor,

Thank you for your reply.

I wish we could have more open discussion about the rules and because it seems the exchange is not very fertile I am opening a bit of my experiences of testing and playing with them. Hopefully I am able to get some comments and hints how to use the QT Trader more effectively and one point to be able to make money instead of loosing it.

Few questions:
1. What do you need to do if you want to trade USD-BITCOIN and USD-LITECOIN at the same time? Is it enough to have one API key to USD-BTC, another API key to use with USD-LTC, and then just launch two different QT Trader programs with different user accounts at your PC?

You need two pairs of API keys for now. And make requests interval twice larger. So you will be able to run two instancess of program without issues.
Also I think I'll make improvements on BTC-e and multi currency trading will works soon.

2. Would be great to have possibility to set rules with % (I know it is coming) and also possibility to execute them x many times on top of the sequential and concurrent modes.

I'm currently working on it.

3. This might be totally stupid question but why there is no possibility to trade between different exchanges for example between BTC-E and Mt.G?

I have planted multi exchange trading support to Qt Open Trader.

For my surprise trade "Group 2" was made like it should, but the Qt Trader did not show it to me when the program was running.

Does anyone else have the same problem and why this happens?

What did I set up wrong since the rule "Group 2" sold all my BTC but "Group 3" did not protect my balance?

This is a bug and I have fixed it. Update will be available soon.

From looking over my fork of the code, when there are orders waiting to be submitted, those get priority over other API calls, so you could continue to send trade orders in while the balances and prices haven't been updated. (this seemed more of an issue on polled exchanges like BTCe. I didn't notice it happening on MtGox, which I am assuming is because of MtGox's streaming socket taking a more active role in keeping API clients current. I don't do much trading on MtGox, however, with only a balance of 0.4 BTC there, for testing purposes, so perhaps that has something to do with it too.)

I had to make some changes to disable the USD/BTC price boxes whenever a trade was sent in, and all rules would fail (except for enable/disable rules and cancel order actions) until the client received an updated balance from the exchange (even if the actual balance hadn't changed yet, the exchange at least confirmed that the numbers were still good)

I also had to implement my own delay between executing a trading rule, allowing the client time to update the exchange info, as the built in safe-mode delay I could never get to function properly.

Unfortunately, these changes would not be compatable with the existing code now as I have changed too much code to make merging the patch possible, but this should give ideas of where the problem lies, and a possible solution to deal with it, for someone else who is actively contributing to the main branch.

=squeak=


I have already made rules fixes. And now rules executing correctly. I'll publish update soon.

You can tell me about your implementation of delay, and why safe-mode delay not works for you?
sr. member
Activity: 450
Merit: 250
From looking over my fork of the code, when there are orders waiting to be submitted, those get priority over other API calls, so you could continue to send trade orders in while the balances and prices haven't been updated. (this seemed more of an issue on polled exchanges like BTCe. I didn't notice it happening on MtGox, which I am assuming is because of MtGox's streaming socket taking a more active role in keeping API clients current. I don't do much trading on MtGox, however, with only a balance of 0.4 BTC there, for testing purposes, so perhaps that has something to do with it too.)

I had to make some changes to disable the USD/BTC price boxes whenever a trade was sent in, and all rules would fail (except for enable/disable rules and cancel order actions) until the client received an updated balance from the exchange (even if the actual balance hadn't changed yet, the exchange at least confirmed that the numbers were still good)

I also had to implement my own delay between executing a trading rule, allowing the client time to update the exchange info, as the built in safe-mode delay I could never get to function properly.

Unfortunately, these changes would not be compatable with the existing code now as I have changed too much code to make merging the patch possible, but this should give ideas of where the problem lies, and a possible solution to deal with it, for someone else who is actively contributing to the main branch.

=squeak=
newbie
Activity: 10
Merit: 0
Hello Ighor,

Thank you for your reply.

I wish we could have more open discussion about the rules and because it seems the exchange is not very fertile I am opening a bit of my experiences of testing and playing with them. Hopefully I am able to get some comments and hints how to use the QT Trader more effectively and one point to be able to make money instead of loosing it.

Few questions:
1. What do you need to do if you want to trade USD-BITCOIN and USD-LITECOIN at the same time? Is it enough to have one API key to USD-BTC, another API key to use with USD-LTC, and then just launch two different QT Trader programs with different user accounts at your PC?   

2. Would be great to have possibility to set rules with % (I know it is coming) and also possibility to execute them x many times on top of the sequential and concurrent modes.

3. This might be totally stupid question but why there is no possibility to trade between different exchanges for example between BTC-E and Mt.G?


There is a lot of in the QT Trader I do not understand (hopefully we could have UM or Wiki one day) which also sometimes makes me think is there a bug in the software or is it only my noobines with QT Trader and trading currencies generally.

Few question about the rules:

1. I set up rule "Group 2":
http://imageshack.com/a/img707/2424/g8bg.jpg
For me the software should sell BTC in this case but nothing happened in the "Your Open Orders" page showing only "No Open Orders". 


I let the PC for a 20-30 minutes and after that I reboot the QT Trader and checked the "My Orders Log":
http://imageshack.com/a/img11/3369/rpov.jpg
For my surprise trade "Group 2" was made like it should, but the Qt Trader did not show it to me when the program was running.

Does anyone else have the same problem and why this happens?


2. I have also this rule "Group 3":
http://imageshack.com/a/img35/4257/fiqn.jpg
For my big surprise the QT Trader sold all my BTC, but according to the above rule this should not be possible.

What did I set up wrong since the rule "Group 2" sold all my BTC but "Group 3" did not protect my balance?
 

3. For me it would make a sense to "play" with some of the funds loaded to the exchange but keep safe certain amount of USD, BTC, LTC etc. However it seems that for me when I am trying to make the rules for active daily trading I end up to spend all of my current BTC and have lot of USD or vice versa. At the end we could develop and help each other to get most out of the QT Trader and hopefully forum users could post their suggestions how to set up rules for:
a. Get advantage of the daily variation of the BTC
b. Get advantage of the USA / Europe / Asia time zone difference in daily trade
c. Get advantage of the weekly variation of the BTC (for me BTC seems to rise from the beginning of the week towards the weekend and drop at weekend, at least in the past)
d. Protect for BTC collapse
 

I am definitely going to donate as soon as my trade record with QT Trader starts to look more positive. I am wondering what is the amount how much people normally donate?

legendary
Activity: 1035
Merit: 1065
Is the market high and low displayed at the upper right corner of the QT Trader showing past week rates?

If so does it start a new sequence every Sunday at 00:00 or when/how the high and low data is composed?

Thank you for the help!


Market data gets directly from API. So it daily values.
newbie
Activity: 10
Merit: 0
Is the market high and low displayed at the upper right corner of the QT Trader showing past week rates?

If so does it start a new sequence every Sunday at 00:00 or when/how the high and low data is composed?

Thank you for the help!
legendary
Activity: 1035
Merit: 1065
Still doesn't seem to be working for me, even with the latest update... Placed the below rule as a stop loss, it executed the rule, but did not make the trade.



Hi. Do you see your correct balance?
Please contact me by email and we will debug it tomorrow.
newbie
Activity: 25
Merit: 0
Still doesn't seem to be working for me, even with the latest update... Placed the below rule as a stop loss, it executed the rule, but did not make the trade.

https://i.imgur.com/OMmkbr1.png
legendary
Activity: 1035
Merit: 1065
I don't know if anyone else is having trouble here, but when I set rules on BTCChina, the rules get executed correctly (it says "done" and is highlighted in green) but the orders attached to the rules don't go through. For example, as a test, I set this rule as a stop loss for a sell I made:



This rule is executed, but the consequent order is not placed, and I'm left with the same BTC balance. Would be great if someone could comment on this.

Or perhaps there's a simpler way to set stop losses and profit targets?

Otherwise, I absolutely love QT. Great job Ighor!

Hi. Updated today with buy all in fix.
Please restart app and check for updates.
And update to newest version.
newbie
Activity: 25
Merit: 0
I don't know if anyone else is having trouble here, but when I set rules on BTCChina, the rules get executed correctly (it says "done" and is highlighted in green) but the orders attached to the rules don't go through. For example, as a test, I set this rule as a stop loss for a sell I made:

https://i.imgur.com/3NhjZLP.png

This rule is executed, but the consequent order is not placed, and I'm left with the same BTC balance. Would be great if someone could comment on this.

Or perhaps there's a simpler way to set stop losses and profit targets?

Otherwise, I absolutely love QT. Great job Ighor!
Pages:
Jump to: