Bob Matthews

Rancher
+ Follow
since Jan 01, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bob Matthews

Norm

google https://waitematawoodys.com/2016/03/12/lionel-jefcoat-boatbuilder-wood-craftsman/

Saffron - now mine, purchased in 2020, is mentioned here

It was Lionel's 57th yacht/boat - designed and built for himself - launched in 2010

Bob M
9 months ago
small world.........

take care

Bob M
9 months ago
No - spot on

Thanks

Bob M
on sv Saffron
Havelock Marina
Marlborough
New Zealand
9 months ago
Hello Norm
(apologies for going over old ground)

1) I log into the binary options platform on Dukascopy and up comes their trading screen with the two buttons

2) I also log into the normal trading platform on Dukascopy - which is provided with an API and where I can run my java program which calculates various variables and decides that it would like to open a binary option

here is where I have a problem......................

1) and 2) are completely separate but I am assuming that I can keep the screen from 1) open all the time, thus seeing the two buttons all the time

I want to add a piece of code to the java program in 2) to automatically click one of the two buttons

I think I can pre-set the other inputs such as instrument, amount, duration etc. so that they will always read what I have setup

I can give the robot the pixel location of the centre of both buttons

Bob M

9 months ago
Pieter:

yes - normally one would be expected to click on a button on the screen

I wish to program so that it is done automatically, when my java strategy wishes to open a option trade
9 months ago
Using the robot class..............

1.Import package: Robot class has to import first, to use.

import java.awt.Robot;

2. Instantiate: A robot class object is needed to invoke its methods. So, let’s instantiate the Robot class.

Robot robot = new Robot();

3. Invoke method: Now invoke the required method on robot object.

robot.<required_method>();

and......................

Mouse Methods:

   mousePress(int buttons): This method presses one or more mouse buttons.For Example, mousePress(InputEvent.BUTTON1_DOWN_MASK) method is used left click mouse button
   mouseRelease(int buttons): This method releases one or more mouse buttons. For Example, mouseRelease(InputEvent.BUTTON1_DOWN_MASK) method is used to release the left mouse button click
   mouseMove(int x, int y): This method moves the mouse pointer to given screen coordinates specified by x and y values. For Example, mouseMove(100, 50) will move the mouse pointer to the x coordinate 100 and y coordinate 50 on the screen.

so, I need to put all this together ?

Bob M

9 months ago
Hello Pieter

"Rest API" ...have googled...............

"your endpoint" -  is this where my java strategy has got to the stage where it wants to open a binary option ?

//do something - click a button ?

Have I got the gist of what you are saying ?

Bob M
9 months ago
There are two types of trading one can do on Dukascopy Platforms
The first is trading controlled by a strategy written in java and using a Dukascopy API
The second is trading binary options
Here you decide whether the price is going to go up or down
There is no Dukascopy API and so trading must be done manually by clicking on a 'Call' or 'Put' button
see attached screen image

I would like to try and make the process of submitting an order by creating an external connection management module
This module would take a decision from a typical strategy as used in the first type of trading described above
If the decision is to BUY, it would click the 'CALL' button thus submitting a buy order
If the decision is to SELL, it would click the 'PUT' button thus submitting a sell order

As you can see, there are other variables to set such as the instrument, amount, duration and payout, but leaving those aside for the moment

Could someone get me started on how to code such a connection management module (in java)

I guess one of the obvious things I need to do is to note the pixel location for the corners of each of the two buttons which need to be clicked

Many thanks

Bob M
9 months ago
I have access through an educational institution though

Bob M

I would be happy to share the paper, though, with the help I have received to date
10 months ago
I have a copy of the paper (as a .pdf)................

How can I share it ?

Bob M
10 months ago
if you google:-

Forecasting financial signal for automated trading: An interpretable approach

you should locate the full paper

p.s. there are hundreds of such papers BUT the bridge between academia and the real world can sometime be huge

Bob M
10 months ago
Piet:

In the original diagram of the 25 cluster plots, there are 8 'buys', 6 ''sells' and 11 'no action'
Note: that diagram only represents actions for the 25 clusters of the EUR/USD pair


Adopting the best action for cluster representatives

As discussed in the previous sections, clustering is done on the market 5-h prices to find representative for each time t of the market
based on its next 5-h time frame.
The cluster representatives are mapped to one of the possible actions (buy, sell and no action) at last. To find the best action for each representative, total profit is then calculated for each possible action during an optimization time interval and the action that achieves the most total profit is selected as the optimal action for that representative.



The mapping is carried out using the optimization tools in MetaTrader

What does it mean to be in a cluster ?

I was under the impression that it meant that the 5 consecutive hourly prices showed a similar plot trend BUT the author insists that the clustering is carried out with no transformation or normalization of the prices

Therefore, the clustering simply results in 25 clusters where the centroid is at different price levels
i.e. in my large database of 5 hour prices - x% [3% - 6%, say] of the highest average price would be grouped in the one cluster
What that achieves, I have no idea

Bob M
10 months ago
I have run the clustering program using 'weka' and attach the results................

It would appear that I misunderstood exactly what data is used as input

I see the centroid detail is listed for all 25 clusters

Still don't understand what the 'plots' are supposed to represent.................

Bob M

----------------------------------------------------------------------------------------------------------
=== Run information ===

Scheme:       weka.clusterers.SimpleKMeans -init 0 -max-candidates 100 -periodic-pruning 10000 -min-density 2.0 -t1 -1.25 -t2 -1.0 -N 25 -A "weka.core.EuclideanDistance -R first-last" -I 1500 -O -num-slots 1 -S 10
Relation:     training data for clustering
Instances:    62398
Attributes:   5
             candle1
             candle2
             candle3
             candle4
             candle5
Test mode:    evaluate on training data


=== Clustering model (full training set) ===


kMeans
======

Number of iterations: 305
Within cluster sum of squared errors: 40.4800242793637

Initial starting points (random):

Cluster 0: 1.299835,1.300345,1.300785,1.30009,1.29988
Cluster 1: 1.27397,1.27326,1.273875,1.274155,1.27383
Cluster 2: 1.04852,1.048515,1.047415,1.044785,1.04184
Cluster 3: 1.320755,1.319405,1.320255,1.320405,1.319805
Cluster 4: 1.05213,1.05485,1.06014,1.06159,1.05983
Cluster 5: 1.07149,1.072655,1.07323,1.07319,1.07297
Cluster 6: 1.32235,1.321235,1.32268,1.32406,1.327885
Cluster 7: 1.270845,1.27002,1.268925,1.268755,1.269575
Cluster 8: 1.1214,1.12092,1.12134,1.122095,1.123355
Cluster 9: 1.236225,1.234665,1.23408,1.233875,1.232735
Cluster 10: 1.13779,1.137765,1.138005,1.137455,1.13767
Cluster 11: 1.246405,1.24627,1.24538,1.24439,1.24281
Cluster 12: 1.301975,1.30129,1.300455,1.29885,1.29567
Cluster 13: 1.259345,1.258585,1.259065,1.258975,1.258805
Cluster 14: 1.256445,1.25648,1.256605,1.2564,1.25641
Cluster 15: 1.34786,1.348435,1.348945,1.350235,1.35125
Cluster 16: 1.11622,1.11517,1.113335,1.11363,1.113705
Cluster 17: 1.159115,1.158445,1.157015,1.15705,1.157695
Cluster 18: 1.31252,1.31206,1.31201,1.31192,1.31207
Cluster 19: 1.15592,1.156625,1.15649,1.156315,1.15637
Cluster 20: 1.23376,1.23418,1.233805,1.234075,1.23443
Cluster 21: 1.394965,1.39582,1.396385,1.39644,1.395775
Cluster 22: 1.124785,1.123835,1.123435,1.12349,1.123675
Cluster 23: 1.350355,1.356245,1.35782,1.357865,1.35726
Cluster 24: 1.047995,1.04722,1.046575,1.046925,1.04713

Missing values globally replaced with mean/mode

Final cluster centroids:
                        Cluster#
Attribute    Full Data          0          1          2          3          4          5          6          7          8          9         10         11         12         13         14         15         16         17         18         19         20         21         22         23         24
            (62398.0)   (3497.0)   (3645.0)    (471.0)   (3543.0)   (1411.0)   (2274.0)   (2397.0)   (3112.0)   (3350.0)   (2382.0)   (2743.0)   (1894.0)   (3465.0)   (2201.0)   (1771.0)   (2643.0)   (2082.0)   (2607.0)   (4634.0)   (2408.0)   (1336.0)   (1574.0)   (2711.0)   (2351.0)   (1896.0)
=========================================================================================================================================================================================================================================================================================================
candle1         1.2585     1.3383     1.3073     1.0465      1.374     1.0742     1.0892     1.3933     1.2922     1.1169     1.2263     1.1401      1.241     1.3224     1.2752     1.2577     1.4191     1.1024     1.1784     1.3575     1.1618     1.1971     1.4852     1.1287     1.4444     1.0612
candle2         1.2585     1.3383     1.3073     1.0465      1.374     1.0742     1.0892     1.3933     1.2922     1.1168     1.2263     1.1401      1.241     1.3223     1.2752     1.2577     1.4191     1.1024     1.1784     1.3574     1.1618      1.197     1.4852     1.1288     1.4445     1.0612
candle3         1.2585     1.3383     1.3073     1.0464      1.374     1.0743     1.0892     1.3933     1.2922     1.1168     1.2263     1.1402      1.241     1.3223     1.2752     1.2577      1.419     1.1024     1.1784     1.3574     1.1618      1.197     1.4852     1.1288     1.4445     1.0611
candle4         1.2585     1.3383     1.3073     1.0465      1.374     1.0743     1.0892     1.3933     1.2922     1.1168     1.2263     1.1401      1.241     1.3224     1.2752     1.2576      1.419     1.1024     1.1784     1.3574     1.1618      1.197     1.4852     1.1288     1.4445     1.0611
candle5         1.2585     1.3382     1.3073     1.0465      1.374     1.0742     1.0892     1.3932     1.2922     1.1169     1.2263     1.1401      1.241     1.3224     1.2752     1.2577     1.4191     1.1024     1.1784     1.3574     1.1618      1.197     1.4851     1.1287     1.4444     1.0612




Time taken to build model (full training data) : 10.89 seconds

=== Model and evaluation on training set ===

Clustered Instances

0       3497 (  6%)
1       3645 (  6%)
2        471 (  1%)
3       3543 (  6%)
4       1411 (  2%)
5       2274 (  4%)
6       2397 (  4%)
7       3112 (  5%)
8       3350 (  5%)
9       2382 (  4%)
10       2743 (  4%)
11       1894 (  3%)
12       3465 (  6%)
13       2201 (  4%)
14       1771 (  3%)
15       2643 (  4%)
16       2082 (  3%)
17       2607 (  4%)
18       4634 (  7%)
19       2408 (  4%)
20       1336 (  2%)
21       1574 (  3%)
22       2711 (  4%)
23       2351 (  4%)
24       1896 (  3%)

---------------------------------------------------------------------------------------------------------------
10 months ago


After training the Action Selection Model, this optimization was done by the optimization tools in MetaTrader (from Strategy Tester).



Piet: the above is a comment from the author of the paper

Bob M
10 months ago


There is not any normalization or transformation. The 5x1 vectors fed to the clustering model are the concatenation of the avg of closing and opening of the next 5 H candles. So, as you noticed, that is the actual value. What you can find in Table 5 is the representation of clusters’ centers (the x-axis shows 1…5 following candles, and the y-axis of plots is the price value BUT the range of y-axis for clusters are NOT the same)



The above is a comment from the author of the paper

Bob M

so no normalization or transformation - very confusing to me
10 months ago