Login Page - Create Account

Support Board


Date/Time: Sat, 22 Jun 2024 06:23:19 +0000



[Programming Help] - Entry accuracy issues in automated trading

View Count: 263

[2024-04-27 06:01:11]
alexo2022 - Posts: 38
I have a 50 tick chart, and using automated trading with color bar based on alert condition combined with spreadsheet.

in the the color bar based on alert condition - the alert is triggered when the price is crossing the pivot point R.5 from below

this is the formula -

=OR(L=ID1.SG5,CROSSFROMBELOW(L,ID1.SG5))

and then I have formula in the "sell entry column" in the spreadsheet to enter short when this is true.

in the 26.04.24 the value of R.5 was 5129.63, during the trading, the software entered trades that has nothing to do with the formula (see attachment).

why this is happening ?
Date Time Of Last Edit: 2024-04-27 09:21:35
imagewrong trades.jpg / V - Attached On 2024-04-27 05:59:55 UTC - Size: 188.93 KB - 45 views
[2024-04-27 13:57:53]
Sawtooth - Posts: 4028
Check the Trade Service log for info about the entries.

Suggestion:
- Instead of using the Color bar study for entry signals, use this spreadsheet syntax formula in M3:
=OR(D3=ID1.SG5@3,CROSSFROMBELOW(D3:D4,ID1.SG5@3:ID1.SG5@4))
[2024-04-27 15:18:15]
alexo2022 - Posts: 38
thanks for your response,


it it written in the 'trade service log' that the formula is true, and the trigger is activated.

I'm using the color bar study for the signal, and then when the signal is true, I reference this study
on the spreadsheet, for entering the trade.

my entry formula is in the spreadsheet sell entry column (M),
can you please explain the difference between the formula you wrote and what I wrote ?


If I set the formula you wrote, I don't need to use the color bar study at all ?

thanks,
Date Time Of Last Edit: 2024-04-27 15:19:40
[2024-04-27 15:42:24]
Sawtooth - Posts: 4028
If I set the formula you wrote, I don't need to use the color bar study at all ?
That is correct.

It would be more efficient to not use the color bar study.
[2024-04-27 16:05:08]
alexo2022 - Posts: 38
the reason I'm using the color bar study is the formula syntax,
for example when I want to reference the "Last" price, I just write "L",
but when using the spreadsheet, I need to write range,
but I do I make sure the rage I write is similar to the Last I reference in the color bar study ?
[2024-04-27 20:33:15]
Sawtooth - Posts: 4028
In Alert syntax, L is Low
The Last price is C
Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables

So if you want to reference the Last price, the formula in spreadsheet syntax would be:
=OR(E3=ID1.SG5@3,CROSSFROMBELOW(E3:E4,ID1.SG5@3:ID1.SG5@4))

The CROSSFROMBELOW function requires a range in spreadsheet syntax, where you can use any range.
The CROSSFROMBELOW function in Alert syntax assumes range of only the current and previous bars.
[2024-04-28 15:07:41]
alexo2022 - Posts: 38
When I'm using the color bar study the alert formula is -
=OR(L=ID1.SG5,CROSSFROMBELOW(L,ID1.SG5))


and the settings and input -

Numbers of bars to calculate (ln:2) - 2000
Input data (ln:6) - Last

(see attachment)

when I writing the formula you wrote
=OR(E3=ID1.SG5@3,CROSSFROMBELOW(E3:E4,ID1.SG5@3:ID1.SG5@4))

I'm not getting same entry results,
how can I can get the same results using formula instead of the color bar?
and how can I make sure, the software doesn't getting inaccurate entry points ?
imageColorBar - Setting and Input.JPG / V - Attached On 2024-04-28 15:07:24 UTC - Size: 131.75 KB - 38 views
[2024-04-28 23:05:59]
Sawtooth - Posts: 4028
You cannot use L to get the Last price. The Last price is not L, it is C.

The Last price on the spreadsheet is in E3, so the equivalent is C for the color bar study
The Low on the spreadsheet is in D3, so the equivalent is L for the color bar study.

This is why they are not the same.
[2024-04-29 11:46:12]
alexo2022 - Posts: 38
I understand what you wrote, my question is what the input data in the color bar alert study mean,
you can choose "open", "high", "Low", "Last".

if I choose "last" for example, how it's affecting the alert ?

and if I decide to use a formula instead of the color bar alert,
how can I produce the same result as if I was choosing "last" in the input in the color bar alert.
[2024-04-29 12:31:00]
Sawtooth - Posts: 4028
The 'Input Data' of OHLC etc is only used when the 'Output When Condition True' is set to 'Use Input Data'.
That setting has no effect on the T/F of the alert.
Color Bar Based on Alert Condition: Output When Condition Is True

if I decide to use a formula instead of the color bar alert, how can I produce the same result
=OR(D3=ID1.SG5@3,CROSSFROMBELOW(D3:D4,ID1.SG5@3:ID1.SG5@4)) on the spreadsheet will produce the same result as
=OR(L=ID1.SG5,CROSSFROMBELOW(L,ID1.SG5)) on the Alerts tab of the color bar study.
[2024-04-29 16:15:01]
alexo2022 - Posts: 38
Thanks for the help.

just for others who will read this in the future,
regarding the entry accuracy problems I had,

I read the log, and find out there were other sheets in the spreadsheet
that were running also automated trading,
so the problem was that I had multiple sheets running automated trading simultaneously,
and that's why I saw "inaccurate" entry points.
[2024-04-29 16:35:04]
alexo2022 - Posts: 38
if I'm using this formula
=OR(D3=ID1.SG5@3,CROSSFROMBELOW(D3:D4,ID1.SG5@3:ID1.SG5@4))
,
is there a way I can limit the amount of trades that are taken on this pivot line,

for example I want after 3 trades on this line, to stop the trades on this line,
it mean that I don't want to stop all the automated trading,
I want to stop the trading on this line,
but if the price moves to other pivot line,
I want the software to take the trade,
but also limit to only 3 trades on this new line.


in summary, every pivot line need to have a Limit of the only 3 first trades.
[2024-04-29 20:01:00]
Sawtooth - Posts: 4028
is there a way I can limit the amount of trades that are taken on this pivot line?
What you are asking is complex, and beyond the scope of a forum post.

You can Direct Message me for a quote.

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

Login

Login Page - Create Account