Bitcoin Forum
May 14, 2024, 02:05:47 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: 1 2 [All]
  Print  
Author Topic: Qt Bitcoin Trader - Dedicated rule configuration thread  (Read 8065 times)
Netprofits (OP)
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
December 03, 2013, 04:16:55 PM
 #1

The Qt Bitcoin Trader is the best, opensource program available for trading IMO.  If a better one exists, I am yet to find it.  The idea behind this thread is to consolidate all input on properly designing and implementing rules within the program.  This can prove to be a daunting task for many and by tapping into the collective intelligence on Bitcointalk, I hope to simplify proper rule construction for others; both new and experienced users alike. 

Please contribute, subscribe and assist in this altruistic endeavor.    Grin





The Qt Bitcoin Trader application is absolutely amazing!  If you have not tried it, do so immediately.  After realizing the potential and ease of use the Qt Bitcoin Trader provides, be sure to make a donation to the dev, IGHOR.   Donate:  1d6iMwjjNo8ZGYeJBZKXgcgVk9o7fXcjc

IGHOR's official Qt Bitcoin Trader thread can be found here:  https://bitcointalk.org/index.php?topic=201062.0
1715695547
Hero Member
*
Offline Offline

Posts: 1715695547

View Profile Personal Message (Offline)

Ignore
1715695547
Reply with quote  #2

1715695547
Report to moderator
1715695547
Hero Member
*
Offline Offline

Posts: 1715695547

View Profile Personal Message (Offline)

Ignore
1715695547
Reply with quote  #2

1715695547
Report to moderator
1715695547
Hero Member
*
Offline Offline

Posts: 1715695547

View Profile Personal Message (Offline)

Ignore
1715695547
Reply with quote  #2

1715695547
Report to moderator
I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715695547
Hero Member
*
Offline Offline

Posts: 1715695547

View Profile Personal Message (Offline)

Ignore
1715695547
Reply with quote  #2

1715695547
Report to moderator
1715695547
Hero Member
*
Offline Offline

Posts: 1715695547

View Profile Personal Message (Offline)

Ignore
1715695547
Reply with quote  #2

1715695547
Report to moderator
maz
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
December 03, 2013, 07:13:25 PM
 #2

The Qt Bitcoin Trader is the best, opensource program available for trading IMO.  If a better one exists, I am yet to find it.  The idea behind this thread is to consolidate all input on properly designing and implementing rules within the program.  This can prove to be a daunting task for many and by tapping into the collective intelligence on Bitcointalk, I hope to simplify proper rule construction for others; both new and experienced users alike. 

Please contribute, subscribe and assist in this altruistic endeavor.    Grin

The Qt Bitcoin Trader application is absolutely amazing!  If you have not tried it, do so immediately.  After realizing the potential and ease of use the Qt Bitcoin Trader provides, be sure to make a donation to the dev, IGHOR.   Donate:  1d6iMwjjNo8ZGYeJBZKXgcgVk9o7fXcjc

IGHOR's official Qt Bitcoin Trader thread can be found here:  https://bitcointalk.org/index.php?topic=201062.0

Great idea Netprofits,

Do you have any that you could share with us?

I currently only use the rules for buying bitcoin's in the event of a flash crash when I am away from the computer. After consulting member 'sootha' on the QtTrader thread I now use the following rule for this.

Example: I am hoping the price of bitcoin will fall below $900 but I must go to work where I can't trade, so the rule I set at home is:

IF 'Market Last Price' GOES LESS THEN '$900' SPEND ALL MY FUNDS @ 'Market Last Price'

This should buy all the coins I can afford if the price plummits to 890 / 750 / 600 etc, but more probably you would get the higher price than lower, however I don't know how API lag effects the bots ability to catch the price, if the API lag is 10 seconds and the price drops to 500 in that time, then you may get a purchase at 500? not sure, but would be nice to test.
Netprofits (OP)
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
December 03, 2013, 10:19:22 PM
Last edit: December 03, 2013, 10:36:04 PM by Netprofits
 #3


Great idea Netprofits,

Do you have any that you could share with us?

Thanks and welcome, Maz!  I use a number of rather simple rules currently which allow me to quickly disable or enable them or adjust pricing as opposed to attempting to create new rules in a dynamic market.  It is obviously critical to be able to react quickly if you are attempting to interpret and reposition yourself in a fast-moving market.  

Today, I expect a test of 1185 (gox).  Therefore, I chose a top (and bottom) for my next trade(s).  I began with a rule to initiate my sale(s) using Sell All or Sell Half @ exact price) at a dollar or so below the closest wall or resistance cluster near the price(s) I chose.  My ask(s) will not appear in the order book until my pre-selected price point is broken.  My intention is to sell into a decent buy order where there is someone pushing the levels well beyond buy support.

I set a number of rules to be available based on the order book to buy back on a dip or even occasionally, bite the bullet, and buy back into a spike.  I constantly monitor the order book and adjust my prices as necessary while trading.  I also try to average my gains or losses by utilizing 2 (or more) price points up and down from my initial buy (or sell) as mentioned.  It is obviously very simple to only use two points in QT as in:

-Sell Half followed by a Sell All or conversely Spend Half my Funds followed by Spend All my Funds-

I read member @sootha's post and learned some things myself.  I am going to go through the tread once more and PM those who were kind enough to share some really great stuff.   Smiley
Voodah
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
December 04, 2013, 01:52:32 AM
 #4

Following.
Netprofits (OP)
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
December 04, 2013, 03:37:35 AM
 #5

Following.

Welcome, Voodah!  If you or anyone else would like to share how they use QT with rules, please do so.  I also think if someone has a question about configuring a specific rule or set of rules in order to achieve a desired result, they should post that particular query.  This way folks far more experienced than myself using QT or even trading for that matter, will hopefully see it and contribute to this thread.

Good Day!
Netprofits (OP)
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
December 04, 2013, 04:27:08 PM
 #6

Last trades:  Sell Half @ 1185.9 & Sell All @ 1199.9 executed by QT on Gox.  
r0sc0e
Full Member
***
Offline Offline

Activity: 143
Merit: 100


View Profile
December 04, 2013, 06:41:17 PM
 #7

New version is coming today ( i hope )
soothaa
Hero Member
*****
Offline Offline

Activity: 1151
Merit: 528



View Profile
December 04, 2013, 07:03:36 PM
 #8

I really want boolean/complicated rules.

If bitcoin < 1100 && litcoin down 10%, sell all litecoin, but all bitcoin.

Want increased coin support within AwesomeMiner? Try my free plugin to add support for nearly any coin! https://bitcointalk.org/index.php?topic=2979494
Want Masternode income stats within AwesomeMiner? Try my free plugin to add support for them! https://bitcointalk.org/index.php?topic=3047367
r0sc0e
Full Member
***
Offline Offline

Activity: 143
Merit: 100


View Profile
December 04, 2013, 07:25:27 PM
 #9

for new feature we have to help IGHOR with donations, please help to get some coins for his excellent work! :-)
Netprofits (OP)
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
December 05, 2013, 04:36:10 PM
Last edit: December 05, 2013, 04:47:28 PM by Netprofits
 #10

I really want boolean/complicated rules.

If bitcoin < 1100 && litcoin down 10%, sell all litecoin, but all bitcoin.

Welcome, soothaa!  Indeed.  This is an area I would like to see us explore as well, both within and among different coins.  I lost a lot of potential profits last night while I slept and my normal strategy was implemented by QT during the retrace.  

Code:
I would like to gauge the % of change and/or acceleration of a dip/rally and regulate the turning on and off of preset buy/sell orders.
Netprofits (OP)
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
December 05, 2013, 04:38:12 PM
 #11

New version is coming today ( i hope )

Welcome, r0sc0e!  Thanks for the information and I appreciate you joining the thread.   
soothaa
Hero Member
*****
Offline Offline

Activity: 1151
Merit: 528



View Profile
December 05, 2013, 07:21:02 PM
 #12

I really want boolean/complicated rules.

If bitcoin < 1100 && litcoin down 10%, sell all litecoin, but all bitcoin.

Welcome, soothaa!  Indeed.  This is an area I would like to see us explore as well, both within and among different coins.  I lost a lot of potential profits last night while I slept and my normal strategy was implemented by QT during the retrace.  

Code:
I would like to gauge the % of change and/or acceleration of a dip/rally and regulate the turning on and off of preset buy/sell orders.
I've checked out the source code and I'm beginning to write a few custom buttons for myself.

Want increased coin support within AwesomeMiner? Try my free plugin to add support for nearly any coin! https://bitcointalk.org/index.php?topic=2979494
Want Masternode income stats within AwesomeMiner? Try my free plugin to add support for them! https://bitcointalk.org/index.php?topic=3047367
paulluopaulluo
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
December 06, 2013, 08:19:03 AM
Last edit: December 06, 2013, 08:33:04 AM by paulluopaulluo
 #13

i've some idea

if we can set

"if the last market price is < or > my XX% last trade price(or last market price) than auto  make a  new order which amount is XX% of my balance(in $/BTC) which price is  XX% market price, & if some Condition has reached than skip out this loop"

than we can make sure if some situation happened like yesterday we still can keep our  BTC not lose too mush even we are not @ PC



surely which XX% is profitable for trade still need to be fine tune & test , i'm work out on it . if you have some idea ,welcome to discuss @ this thread~
Squeaker
Sr. Member
****
Offline Offline

Activity: 450
Merit: 250


View Profile WWW
December 08, 2013, 10:11:29 AM
 #14

Perhaps gather together a list of the various variables/functions we would expect to need for custom rules too.

Things like, the current lowest sell price on the order book, current highest buy price, perhaps functions to return how many you would need to buy or sell to reach the specified price (with an inclusive and exclusive version)

would need to do some basic math... add/subtract/multiply/divide/percent...

subsets would be nice, but if we can make the rule with multiple steps, that would work too

perhaps a timer, or variables we can set... so say, if sell price goes above my target, I could have my behavior set up so it doesn't start selling right away.

for example, say I was setting up my custom rule, that I wanted to sell above 800, if I was currently holding more than 10 BTC (or my BTC value was higher than 60% of my btc_value+usd, meaning my coin-to-fiat ratio was going up), and the highest buy price on the books, had stayed above 800 for over a minute. If all those conditions were true, then place a sell order at 800 for, say, 1% of my balance-on-hand, with a 60 second timer on it to cancel the order (if any is left unfilled), etc.

basically a scripting language of sorts, so we can tailor our own behaviors.

wouldn't really want everybody doing the same exact behavior, or we just end up getting in each other's way.

(and yeah, I know what I'm asking for is a HUGE thing, but hey... gotta have lofty goals to reach for Cheesy )

Love what you guys have done so far with the program (tho being able to change the font size would be a nice thing for these tired old eyes of mine).

EABEAB
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
December 10, 2013, 05:16:14 PM
 #15

I use BtcChina via QT-Trader via BtcChina API, works great for the most part,
but often, and I mean often the connection to the API goes down and the WebSite
is off-line at the same time.

Happen to me last night when I cashed out to Cash / Yuan and the problem did not correct itself
until the next morning, I cashed out at $50,000 Yuan, in the morning when their site came back
on-line the market had raised to $57,580 Yuan, I have been Up-Side Down all day waiting for the
market to either lower itself or make a few good trades to get the coin back I lost, I was at 10 BTC
when the BtChina site went off line, now at the current market rate I'm at 8.8 BTC, even with these
problems it's hard to leave because the trades are FREE, but I'm beginning to ask myself are they
really FREE with missed opportunity costs (a 758 Yuan rise), started out with BiFinex and never had
site down problems except for once, surprised to hear that MtGox and BitStamp also have these problems.


Also Qt-Trader Market High, Low, Last, and BTC Volume fields do not populate when using BtcChina
with those four fields not populating I'm assuming that setting rules using them would also not work on BtcChina.

Also the "All-In" button never works correctly in QT-Trader with BtcChina,
Always have to edit the price by hand manually.



Notice that many have requested "Trailing Stops", still not implemented,
many have also requested the BitFinex API, still not implemented,
which would also more than likely include the "Trailing Stops" automatically.
Percentages asked for, still not implemented.

This problem with BtcChina's API timing-out does not reflect directly upon QT-Trader,
I read another tread which stated it's DDoS attacks from other Exchanges that cause this
and it's the reason that BtcChina's owner, the former CEO of Wal-Mart China decided to offer
"ZERO TRADING FEES - FREE TRADES"

But I'm here to tell you that in the long-run you end up paying when the API and the WebSite both
times out and can't be accessed and the market goes against you, or you miss the train and the market
takes off without you as in my case now, in the end the trades are not FREE

I also have a VPN to try and circumvent the DDoS attacks by changing my I.P. sometimes I can connect again
even whereas from the previous I.P. it was impossible to connect, which leads me to belive they are not really
DDoS Attacks but API Failure, in that if they were really DDoS attacks, one would not be able to connect again
regardless if one changed I.P. or not, but I think that I've learned my lesson and would rather just pay the .12%
fee at BitFinex, this has been a really costly mistake using BtcChina and getting timed-out for a 12-Hour period.

Thanks
battani
Newbie
*
Offline Offline

Activity: 25
Merit: 0



View Profile
December 13, 2013, 05:21:52 PM
 #16

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!
IGHOR
Legendary
*
Offline Offline

Activity: 1035
Merit: 1065



View Profile WWW
December 13, 2013, 05:36:55 PM
 #17

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.

Qt Bitcoin Trader
Verify digital signature of the app in the file properties every time you download it.
battani
Newbie
*
Offline Offline

Activity: 25
Merit: 0



View Profile
December 13, 2013, 11:15:34 PM
 #18

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
IGHOR
Legendary
*
Offline Offline

Activity: 1035
Merit: 1065



View Profile WWW
December 14, 2013, 12:36:19 PM
 #19

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.

Qt Bitcoin Trader
Verify digital signature of the app in the file properties every time you download it.
Wilma
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 28, 2013, 11:56:19 AM
 #20

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!
IGHOR
Legendary
*
Offline Offline

Activity: 1035
Merit: 1065



View Profile WWW
December 28, 2013, 01:39:37 PM
Last edit: January 10, 2014, 05:33:40 PM by IGHOR
 #21

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.

Qt Bitcoin Trader
Verify digital signature of the app in the file properties every time you download it.
Wilma
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
January 10, 2014, 12:45:28 PM
 #22

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?

Squeaker
Sr. Member
****
Offline Offline

Activity: 450
Merit: 250


View Profile WWW
January 10, 2014, 03:17:52 PM
 #23

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=

IGHOR
Legendary
*
Offline Offline

Activity: 1035
Merit: 1065



View Profile WWW
January 10, 2014, 05:46:34 PM
 #24

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?

Qt Bitcoin Trader
Verify digital signature of the app in the file properties every time you download it.
Squeaker
Sr. Member
****
Offline Offline

Activity: 450
Merit: 250


View Profile WWW
January 10, 2014, 08:13:11 PM
 #25

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<baseValues.currentPair.tradePriceMin?baseValues.currentPair.tradePriceMin:priceToExec);
            else mainWindow.apiSellSend(ruleBtc,priceToExec<baseValues.currentPair.tradePriceMin?baseValues.currentPair.tradePriceMin: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"<<priceToExec<<2;
        //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=

Fishbones
Full Member
***
Offline Offline

Activity: 122
Merit: 100


View Profile
January 10, 2014, 11:55:39 PM
 #26

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.
Wilma
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
January 11, 2014, 10:04:25 AM
 #27

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.
Wilma
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
February 11, 2014, 02:39:25 PM
 #28


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



IGHOR
Legendary
*
Offline Offline

Activity: 1035
Merit: 1065



View Profile WWW
February 11, 2014, 03:37:24 PM
 #29


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.

Qt Bitcoin Trader
Verify digital signature of the app in the file properties every time you download it.
Wilma
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
February 11, 2014, 03:43:24 PM
 #30


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.

IGHOR
Legendary
*
Offline Offline

Activity: 1035
Merit: 1065



View Profile WWW
February 11, 2014, 04:05:15 PM
 #31


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.

Qt Bitcoin Trader
Verify digital signature of the app in the file properties every time you download it.
Wilma
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
February 11, 2014, 06:15:10 PM
 #32


Same error. I am using Win 7 64 bit if that matters.
IGHOR
Legendary
*
Offline Offline

Activity: 1035
Merit: 1065



View Profile WWW
February 11, 2014, 08:00:12 PM
 #33


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.

Qt Bitcoin Trader
Verify digital signature of the app in the file properties every time you download it.
Wilma
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
February 11, 2014, 09:19:35 PM
 #34


PM Sent.

CyberMew
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
February 12, 2014, 10:38:40 AM
 #35

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.
Pages: 1 2 [All]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!