Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 02:24:06 +0000



[Programming Help] - Spreadsheet for flattening position

View Count: 309

[2024-04-02 19:21:40]
User594974 - Posts: 34
Hi everyone. I've been banging my head against the wall on this...and it's just gotta be something simple.

I enter the market with discretion, but I want to exit based on a condition with a spreadsheet. The exit condition is very simple...just a close below a moving average. However, I can't seem to get it programmed correctly. Can someone please tell me what I'm missing.

For example...if bar closes below moving average (AA3 in spreadsheet)....flatten position.

I even tried creating a color bar based on alert condition. So when Color bar=1 then flatten. But still can't get it to work.

I must be missing something very small....but I can't figure it out.

Global auto trading is on.
Chart auto trading is on.
Practicing in sim so no need to send position to service yet....but I do have it on.

Can someone help me out here.
[2024-04-02 20:16:17]
Sawtooth - Posts: 4120
I enter the market with discretion, but I want to exit based on a condition with a spreadsheet.
Nothing will happen in SIM if 'Send Orders to Trade Service' is Yes.
These are mutually exclusive.

SIM and 'Send Orders to Trade Service' No
or
Live and 'Send Orders to Trade Service' Yes

Nothing happen in any other combination.
[2024-04-02 20:36:39]
User594974 - Posts: 34
Hi, Thanks for the reply. I've tried it in sim and with a live position...still not getting to exit the position.


I'm currently placing the the condition in J29 to flatten. When I monitor the spreadsheet with a position on, I can watch J29 go from 0 to 1, but the position doesn't flatten.

Any other suggestions that I'm missing?
[2024-04-02 20:53:42]
Sawtooth - Posts: 4120
Any other suggestions that I'm missing?
Check the Trade Service log for why the signal was ignored.
[2024-04-02 21:42:38]
User594974 - Posts: 34
Nothing showing on the trade service log. But, I think I figured it out. Does the spreadsheet not respect alerts for color bars? I removed the color bar signals and just put the condition directly into the spreadsheet and it works.
[2024-04-02 22:29:05]
Sawtooth - Posts: 4120
Does the spreadsheet not respect alerts for color bars?
It does, if there is a 1 in the row of its output column, where its TRUE.
Sometimes a recalc is needed.

Using the spreadsheet directly is the better way anyway.

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

Login

Login Page - Create Account