Login Page - Create Account

Support Board


Date/Time: Thu, 19 Sep 2024 16:39:26 +0000



[User Discussion] - Trading Spreadsheets FX and precision

View Count: 2205

[2014-02-26 12:03:47]
MotoMoto - Posts: 47
I was doing some testing in FX using SC FXCM data. Using SC v1097, and using SIM (but not replay)
As I was getting right down to some tick data to try some things, I noticed a few issues with precision that I had not noticed before, and used this an example in order to really see what happens.
While I follow there are issues with some data feeds, and that there are also occurrences whereby the bids and offers need to be surpassed/bettered for certain orders to be traded.
However - This instance seems to be one regarding precision.(for want of a better word)
It might be particular to spreadsheets and FX, but I just wanted to clarify a few things regards limit orders.

...............
This is a fairly simple test. Buy if the blue line swings up.Exit if it swings down
I set $j$71 Buy Entry: Order Type. M=Market,L=Limit,S=Stop,SL=Stop-Limit,MIT=MarketIfTouched (read/write):
$j$71 = “l” $j$72=”M”
and
Limit or Stop Price - Buy Entry (K) (read/write):
$j$22 = E3+$j$21

Basically - when there is a trigger to buy, buy at the trigger price + 1 tic as a limit order.

1 - attached is a chart of what happened.
Trade 1 - The limit order on the first trade seemed to make sense. 2 bars passed before the limit order was filled.The prices where approximately correct given its FX and there is some rounding.
Trade 2 - this seemed to send a limit order of 4 tics above the trigger price.

This then causes other calculations to be slightly off (in the chart Point 3 shows the blue line where it should be, but the thin green line is where the trigger is calculated off the actual entry. (all fine, except the actual entry should be at a limit order)

2 - attached is also a blown up version to show the actual trigger prices.

(Note: the sell order at market was fine - sell at market means market.)

Basically - I thought there might have been issues regards, the spreadsheets being a little slow, hence the trigger price and the limit price moves, but this did not make sense, OR maybe its FX and SIM trading via FXCM, OR something to do with 1 tic range bars - maybe I am missing something else?

I would have thought a limit order should be sent AT THE PRICE (plus one tic) that the green arrow is showing - the last price for that bar - regardless if the bar is a range bar or not. Or is something extra missing. (I also have have the system set to only trigger on bar close)
Thanks.
Date Time Of Last Edit: 2014-02-26 13:06:04
imageSC_Chart_Orders.png / V - Attached On 2014-02-26 11:50:24 UTC - Size: 33.77 KB - 360 views
imageSC_Chart_Orders2.png / V - Attached On 2014-02-26 11:50:35 UTC - Size: 239.48 KB - 385 views
[2014-02-26 13:41:33]
Sawtooth - Posts: 4091
I would try rounding J21 and OHLC columns to remove any floating point imprecision.

Put this in H21:
=1/ROUND(1/J21,0)

Put these in the respective cells:
AB3:
=MROUND(B3,$H$21)
AC3:
=MROUND(C3,$H$21)
AD3:
=MROUND(D3,$H$21)
AE3:
=MROUND(E3,$H$21)
J22:
AE3+H21

You can use any 4 spare formula columns, but I use AB-AE so they match B-E. (The Number Of Formula Columns needs to be at least 21).

Also, all of your other formulas that reference columns B-E should be edited to reference AB-AE instead.

You might also try setting 'Strict Signal Only On Bar Close Evaluation' to Yes.




[2014-02-26 15:24:01]
MotoMoto - Posts: 47
Hi Tom, thanks for the ideas and solutions.
I implemented them and ran a chart replay at the same place.
What was interesting was that for the first trade trigger at 1.5264, the order sent was now 1.5266 and not as was previously at 1.5265, and it triggers immediately on the next bar rather than 3 bars after as a limit order. The second order triggered and was far easy to track.
However it became easier to track the trades with the better precision.

One thing that became clear as well was that as it using range bars, and tics in FX, and it can move very fast, then using E3 (or the rounded version of E3) is still too slow.
What appears to occur is that the trigger is activated in Column K(green arrow), and in setting the limit in $j$22 if you use E3 as the value to set the limit order, then it may have already changed.
In this instance it was higher, and hence using the E3 as the limit order means you are pretty much using the close of the current bar, which in these cases was 2-4 ticks higher that the trigger. It moves that quickly and the spread may widen.

Hence as an extra amendment I changed the values of $j$22 to this: IF(MAX(K3:K5)>0,MAX(K3:K5)+$H$21,0)
and in Column K I used the formula to show the E3 value of the triggered bar.
As this is only triggered when there is a swing higher (and not just a higher value) you should never get 2 buy entries triggered in a row. This then gave even more precise control.

I figured it is easier then to modify how many ticks slippage from the trigger you are willing to have, and the nature of the beast from my manual testing is that you are better keeping the limit orders rather than simply hitting the market. This way as well the small tick losses are vastly reduced, and while the use of max() is a fudge, it seems to work on subsequent tests.

I guess SC engineering is best to answer this:
is my thought process re the speed correct (not a problem if it is that markets for you :))?

Also using the formula in the limit cell $j$22 - there should be no problems with that?

Thanks Tom - many of us owe you a steak dinner/beer or whatever you fancy, and I am always loving what SC is capable of.




Date Time Of Last Edit: 2014-02-26 15:25:59
[2014-02-26 18:25:43]
Sawtooth - Posts: 4091
in setting the limit in $j$22 if you use E3 as the value to set the limit order, then it may have already changed.

Signal Only On Bar Close only affects Formula Columns, so if you have this set to Yes, you should use E4 (or AE4) in your J22 formula. I should have caught this in my first post.

J22:
AE4+H21

However, your solution would probably accomplish the same thing.
[2014-02-26 22:09:21]
MotoMoto - Posts: 47
Hi Tom,
yes - it only dawned on me and I looked more at the
http://www.sierrachart.com/index.php?l=doc/doc_SystemsAlerts.php#FormulaResultEvaluation

Something I will have to investigate further to better understand as usually I trade around in market orders.
To SC - this answers my questions.
Thanks for the help.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account