Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 22:40:52 +0000



[Programming Help] - SC does not recognize the formulas

View Count: 520

[2022-12-21 19:04:42]
Hopeman - Posts: 156
Hi,

Hi eds, I'm trying to do a backtest with some written formulas! When I do backtest in replay chart mode, everything goes well, but when I choose Auto trade system backtest mode or any other mode,

the program does not read the formulas, so it does not act by opening and closing operations.
read nothing!
Can you be so kind to help me?

Thank you
[2022-12-21 20:17:28]
John - SC Support - Posts: 31362
Keep in mind how the Auto-Trade Backtest mode works, particularly if you are choosing the Bar Based Back-Testing instead of the Replay Back-Testing. Refer to the following:
Auto Trade System Back Testing: Bar Based Back Testing

You simply may need to use the Replay Back-Testing to get the results you need.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-12-23 19:05:21]
Hopeman - Posts: 156
Thank you for the solution that offered me perfectly, excuse me for taking advantage of this thread to ask another question,

I'm trying to add an output to the formula although I'm not sure I'm doing it right since Spreadsheet system for trading marks the ticks in the J28 ticks box instead of points and apparently SC recognizes the formula even so it doesn't trigger it! can you kindly help me to find a solution

=CROSSFROMABOVE((E3:E5,AB3:AB5),OR(J28<12))

Best regards
Date Time Of Last Edit: 2022-12-23 19:59:16
[2022-12-23 20:16:45]
John - SC Support - Posts: 31362
Sorry, but we are not sure exactly what you are wanting to do. In addition J28 in the Spreadsheet System for Trading is "Disable Auto Trading". There is J21 which is "Tick Size", but it doesn't sound like this is what you are referencing. Let us know exactly what you are wanting to do and we will see how to help you.

One item of note - if your formula is to be "CrossFromAbove OR J28<12, then you need to enter it as the following:
=OR(CROSSFROMABOVE(E3:E5, AB3:AB5), J28 < 12)

You can string together multiple items within the OR (or AND) function separated by commas.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-12-23 20:22:39]
Hopeman - Posts: 156
Hello !
Sorry, maybe I'm not expressing myself clearly.

I'm trying to build an Shell Exit with the formula that is based on a certain number of points 3 or ticks 12,

Best Regards.
Date Time Of Last Edit: 2022-12-23 20:24:18
[2022-12-23 20:27:16]
John - SC Support - Posts: 31362
Number of points or ticks of what? Profit? Loss? Either?

Also, why not use a Target/Stop combination to exit the position in this case? Those orders would reside at the market instead of the Spreadsheet needing to send the order from your local computer?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-12-23 20:32:45]
Hopeman - Posts: 156
I rely on market impulses and sometimes they don't have results.

I have the coverage stop but I don't want it to touch it, so I need the spreadsheet for when there is a setback of a certain threshold, the order is cancelled,

Do you know if it is possible or I don't know if there should be a stop chase in case the price does not advance,


Thanks for your attention
Date Time Of Last Edit: 2022-12-23 20:53:35
[2022-12-23 21:10:54]
John - SC Support - Posts: 31362
What you are stating is fine. We just want to make sure you have all the options and information.

So you are wanting to close the position when you have a loss of 3 points or 12 ticks?

To do this you would enter the following in the L column (for a Buy Exit):
=$J$10 / $J$56 < -12

Where J10 is the Open Profit/Loss , J56 is the Currency Value per Tick, so the division of these two gives you the profit/loss in ticks.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-12-25 19:04:09]
Hopeman - Posts: 156
Hello!

I am trying to enter the formula in the "Exit Sell" box =AND(CROSSFROMBELOW(E3:E5,AC3:AC5),OR($J$10 / $J$56 < -12)) apparently it does not send the order, I don't know if it will It is possible that the program fulfills the second condition if the first is not fulfilled I have tried adding AND(OR even so it does not work either, would you be so kind as to help me find the solution if possible?

Thank you
[2022-12-27 18:05:42]
John - SC Support - Posts: 31362
As we mentioned in Post #4 above, you are not using the AND() and OR() functions correctly. If you want to exit the position when either the CROSSFROMBELOW occurs OR when J10/J56 < -12, then you would need to enter this formula in this way:
=OR(CROSSFROMBELOW(E3:E5, AC3:AC5), $J$10/$J$56<-12)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-12-27 20:12:26]
Hopeman - Posts: 156
I have a couple of questions, can you tell me if I can make the spreadsheet not work on certain days of the year?
On the other hand, I am entering this formula so that it stops working at a certain time and returns SYNTAX. I copy it directly from the page. I have tried it several times in different ways and it returns the same error.


AND(J8 = 0, OR(OR(FRACTIME(J41) < TIMEVALUE(“15:40:00"), FRACTIME(J41) > TIMEVALUE(“18:00:00”)), AND(FRACTIME(J41) > TIME VALUE("18:30:00"), FRACTO TIME(J41) < TIME VALUE("22:00:00"))))

Thank you,

You are very kind.
Date Time Of Last Edit: 2022-12-27 20:17:50
[2022-12-27 21:40:27]
Sawtooth - Posts: 3993
You must have manually typed the formula, because it is missing a preceding = and it contains these misspellings and unwanted spaces:
FRACTO TIME
TIME VALUE

If you copy/paste from here...:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetExampleFormulasAndUsage.php#DisableTradingOutsideOfRegularTradingHoursAnd2HoursMidday
... it will not return a #SYNTAX! error.

To copy, highlight the formula in the green field, and press CTRL-C
To paste, press CTRL-V

Then edit the times to your requirements.
Date Time Of Last Edit: 2022-12-27 22:39:39
[2022-12-30 15:53:41]
Hopeman - Posts: 156
Thank you Tomgilb!

I have a question that arises. I am with the spreadsheet system for trading trying to write the following formula in which I want that if the first condition is not met, that the second condition be met or that each one be an independent condition from one another but the two would go in the Buy entry box, I've given it a couple of turns and it gives me various types of errors. I'm a little lost on this topic, would you be so kind to help me,

This is the formula I'm trying to implement


=IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5), AND(CROSSFROMBELOW(AM3:AM5,AW3:AW5), O3, Q3)), IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5), CROSSFROMBELOW(M3:M5,AV3:AV5), O3, Q3)))

Best regards.
[2022-12-30 16:14:51]
Sawtooth - Posts: 3993
You've not told the IF function what to return when TRUE.

The IF function works like this:
If, Then, Else

=IF(condition1, Then x, Else IF(condition2, Then y, Else z))
[2022-12-30 16:18:11]
Hopeman - Posts: 156
My notions of excel are average, can you be so kind to help me describe the exact formula? should i write OR on the second lines?

best regards
Date Time Of Last Edit: 2022-12-30 16:30:11
[2022-12-30 16:36:15]
Sawtooth - Posts: 3993
can you be so kind to help me describe the exact formula?
I cannot because I have no idea what cells contain what conditions.

should i write OR on the second lines?
Maybe you only need to use OR and not IF.
=OR(condition1,condition2)
=OR(AND(CROSSFROMBELOW(E3:E5,AB3:AB5), CROSSFROMBELOW(AM3:AM5,AW3:AW5), O3, Q3), AND(CROSSFROMBELOW(E3:E5,AB3:AB5), CROSSFROMBELOW(M3:M5,AV3:AV5), O3, Q3))
Date Time Of Last Edit: 2022-12-30 18:27:32
[2022-12-30 16:58:30]
Hopeman - Posts: 156
Thanks,

Apparently it doesn't give an error!

I will try it in the next few days,


Have a happy entry into 2023

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

Login

Login Page - Create Account