Support Board
Date/Time: Wed, 27 Nov 2024 06:48:26 +0000
[User Discussion] - Exploring the Reverse Function In Spreadsheet Trading
View Count: 4158
[2014-07-16 20:41:43] |
infpz - Posts: 826 |
I am interested in setting up an strategy based on the price crossing an EMA. If the price cross the EMA from below, I want to be long. If it then comes down and cross the EMA from the top, I want to reverse and actually be short. Similarly, if the price crosses the EMA from above, I want to be short, and it the market were to come back up and cross the EMA from the bottom, I would then want to be long. In other words, once the 1st trade is taken, the system is always in the market, reversing whenever the price cross the EMA. Any suggestions on how to properly begin? The EMA is the only study on the chart currently and is in column AA. Thanks for any help. |
[2014-07-16 20:53:20] |
User021827 - Posts: 174 |
=crossfrombelow(E3:E4,AA3:AA4) this goes in cell under buy entry =crossfromabove(E3:E4,AA3:AA4) goes in cell under sell entry allow reversals must be set to yes in the settings for spreadsheet that is basic crossing signal that will keep you in market and you can use a narrow moving ave instead of price crossing if this gives too many signals. On a small time frame, this could get choppy in a consolidation period. Date Time Of Last Edit: 2014-07-16 20:54:09
|
[2014-07-16 21:07:02] |
infpz - Posts: 826 |
Excellent - appreciate the speedy reply.
|
[2014-07-17 06:13:42] |
Sierra Chart Engineering - Posts: 104368 |
The easiest way to do this is with the Spreadsheet System for Trading study which is documented here: https://www.sierrachart.com/index.php?page=doc/doc_SystemsAlerts.php#GeneralInformation Here is the documentation for Support Reversals: https://www.sierrachart.com/index.php?page=doc/doc_AutoTradeManagment.php#SupportReversals Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2014-07-21 16:39:02] |
infpz - Posts: 826 |
This seems to be working well, except for some reason if the prices crosses the EMA > 1 time inside the bar, only the 1st signal is taken - subsequent signals are ignored. "Signal once per bar" is set to NO. Any further ideas? Thank you, Patrick |
[2014-07-21 22:41:26] |
User021827 - Posts: 174 |
hi perhaps it is the setting " allow opposite entry with opposing entry or position " It is next to "support reversals" I have that set to "yes" for my crossover signals shane |
[2014-07-22 05:15:56] |
Sierra Chart Engineering - Posts: 104368 |
Refer to the documentation here about this: https://www.sierrachart.com/index.php?page=doc/doc_SystemsAlerts.php#IgnoredSignals Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2014-07-22 11:30:33] |
infpz - Posts: 826 |
Thanks for the responses.SC is this the relevant portion? If a cell is TRUE and there is a new bar added to the chart and the cell continues to be TRUE, because the state is already TRUE, you will not get a new signal unless the input Reset Condition on New Bar is set to Yes. If a TRUE signal has been given by the formula in a particular cell and then it goes back to FALSE and back to TRUE on the same bar, you will not get a signal if Signal Only Once Per Bar is set to Yes. I already have both of these set to "No" so I assume some actual reprogramming is needed as described below: In the case of the Buy/Sell Exit Order Action columns when using the Spreadsheet System for Trading study, if an Exit formula is TRUE before there is a Trade Position and then a Trade Position later exists, then it is going to get ignored until it goes back to FALSE and then to TRUE. Therefore, you need to program the formula to remain FALSE until there is a position. One way to get an understanding of how the TRUE signals in K3, L3, M3, N3 are processed is to do the following: Remove the formulas from the K3, L3, M3, N3 cells on the specific Sheet in the Spreadsheet window you are working with. Start a chart replay at a relatively slow speed. For example, on a 1 minute chart you may want to use 20 to 30 times. Enter a 1 in cell K3, L3, M3, or N3 to simulate it becoming TRUE. Enter a 0 to clear that state Or is "allow opposite entry with opposing entry or position" the issue as suggested by User021827? Thank you for your assistance! |
[2014-07-23 01:35:55] |
vegasfoster - Posts: 444 |
Try this
|
[2014-07-23 06:31:45] |
Sierra Chart Engineering - Posts: 104368 |
Thanks for the responses.SC is this the relevant portion? It is hard to say unless we were to analyze your trading system very closely. We do not provide that level of support for trading systems.I already have both of these set to "No" so I assume some actual reprogramming is needed as described below: Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2014-07-23 11:43:13] |
infpz - Posts: 826 |
Vegas, The "allow multiple entries in the same direction" is an issue - the system took me into a 2 lot shortly after I enabled it with your changes". I want it to stay in 1 lot at all times. SC, Sorry for being dense here, but I don't want to have the signal fire only if there is a non-zero position. The system needs to be allowed to reverse. I am just trying to figure out why it will not take the second signal in the same bar, even though "Signal Only Once Per Bar" is set to No. |
[2014-07-23 11:58:21] |
User021827 - Posts: 174 |
that makes me think it is the other setting which prevents and order from being sent if there is an order in place.
|
[2014-07-23 12:32:16] |
infpz - Posts: 826 |
Do you mean "Allow Entry with Working Orders" or something else? Because, I think that refers to working stop or limit orders, not actual positions. This system never has working orders anyway - it is all market orders. So I am not sure that is relevant.
|
[2014-07-23 12:49:13] |
User021827 - Posts: 174 |
1. allow opposite entry with opposing position - this is one I refer to. 2. allow entry with working orders - this is second one. 3. always use market order to flatten position on reversal - this is the third one which may influence your signal. |
[2014-07-23 14:08:29] |
infpz - Posts: 826 |
Firsly, User021827 thank you for your input. 1. I have this set already (Yes) 2. I have this set already (Yes) 3. I had this set to No - I changed it to Yes, but the system is still not responding as desired. The market rips through the EMA for example, gets me short, and then rips higher through the same EMA, and instead of reversing me again (making me long) it leaves me short. Trying to make this as clear as possible: For Buy Entry I am using: =CROSSFROMBELOW(E3:E4,AA3:AA4) For Sell Entry I am using: =CROSSFROMABOVE(E3:E4,AA3:AA4) Thank you for any input. I am still exploring the position check as SC mentioned, but I'm not sure it's relevant since I'm not trying to filter out signals that occur when I already have a position. |
[2014-07-23 14:25:18] |
User021827 - Posts: 174 |
Yes, I see how that has you frustrated. I dont understand how that is happening with your settings as such. I have to defer to SC support on this one. Sorry I cant help you get it squared away. It seems that it should be working as you desired. I use slower signals on larger time frames, so this seems to never be such an issue for me. Is it possible that the market is moving that fast so as to never have the market order get filled ? Also, SC stated that exit formulas must check for position. Perhaps that is the key. " Therefore, you need to program the formula to remain FALSE until there is a position " I do not know how to program that for it to remain false. best regards shane Date Time Of Last Edit: 2014-07-23 14:31:27
|
[2014-07-23 14:35:57] |
infpz - Posts: 826 |
It's all right Shane, thanks anyway. I don't think it's a speed issue - I have seen it on slower timeframes. I will keep working on it. |
[2014-07-24 01:30:02] |
vegasfoster - Posts: 444 |
Vegas,
The "allow multiple entries in the same direction" is an issue - the system took me into a 2 lot shortly after I enabled it with your changes". I want it to stay in 1 lot at all times. It is working for me, unless I don't understand, do you have max position allowed set at 1? |
[2014-07-24 11:22:13] |
infpz - Posts: 826 |
No I do not - but I am going to try to code an exit strategy for L3 and N3 and go from there.
|
[2014-07-30 18:30:44] |
infpz - Posts: 826 |
I have tried to take a different approach. Go Short if: =AND(J8>-1,E3<AA3) (position is not short, and last price is < moving average) Go Long if: =AND(J8<1,E3>AA3) (position is not long, and last price is > moving average) Allow reversals: Yes The problem is, this immediately fires a trade, since we don't wait for a crossover. After some inquiry I found out my main issue is that my "definition" of a crossover is not the same as the chart's definition, and that is what is causing the signal to not fire off twice in one bar. I would like to turn the auto trader on, wait for the last price (E3) to cross the MA (AA3) and then abide by the critera above. With the above code, the result is true immediately, so I get a trade without the first crossover. I think I am almost there but just missing a piece. Thank you |
[2014-08-04 17:48:46] |
infpz - Posts: 826 |
All right folks, I am still stuck here - anyone have any bright ideas for me to try? I am in the same place now as I was in post #20.
Date Time Of Last Edit: 2014-08-04 17:49:13
|
[2014-08-04 19:15:29] |
Sawtooth - Posts: 4120 |
If you want to reverse position intrabar, this will do it: K3: =IF($J$8=0,CROSSFROMBELOW(E3:E4,AA3:AA4),E3>AA3) M3: =IF($J$8=0,CROSSFROMABOVE(E3:E4,AA3:AA4),E3<AA3) This will enter when flat comparing current values to those in the previous bar, then reverse intrabar thereafter. But this will cause multiple successive reversals as price oscillates across the EMA. This is not a winning strategy. To mitigate this, you could reverse position when price has moved n ticks beyond the EMA: K3: =IF($J$8=0,CROSSFROMBELOW(E3:E4,AA3:AA4),E3>AA3+$J$21*1) M3: =IF($J$8=0,CROSSFROMABOVE(E3:E4,AA3:AA4),E3<AA3-$J$21*1) See attached for the settings I used. |
[2014-08-04 19:18:17] |
infpz - Posts: 826 |
Tom - as usual - much appreciated. Will let you know how it works out.
|
[2014-08-04 19:43:32] |
infpz - Posts: 826 |
Tom, quick question using option 1 - everything works well until I get into a trade - then I get a signal each bar no matter what. Any idea how to prevent that? I don't mind the extra signals (I can limit the max position size in the settings and disallow multiple entries in the same market) but it would be helpful.
|
[2014-08-04 19:47:41] |
infpz - Posts: 826 |
The intra-bar reversal, I should add - works great.
|
To post a message in this thread, you need to log in with your Sierra Chart account: