Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 16:05:15 +0000



[Programming Help] - Spreadsheet programming question

View Count: 1293

[2020-04-25 16:09:55]
User183724 - Posts: 183
is there a way to use computed arguments for the MIN function? if i have values in row/columns AF4 and AG4. I want to use those values in the MIN function to find the minimum number in column AE

something similar to:

=MIN(AE(AF4): AE(AG4))


any assistance appreciated. tim
[2020-04-25 17:49:24]
Sawtooth - Posts: 3990
Try this:
=MIN(INDIRECT(CONCATENATE("AE",AF4)):INDIRECT(CONCATENATE("AE",AG4)))
[2020-04-25 18:59:38]
User183724 - Posts: 183
thank you
[2020-05-04 15:04:38]
User185210 - Posts: 57
Hello,

I try to use indirect(concatenate but without success so far,

this is what I did

in cell

bf1= id4.sg3@
bg1= 3
bf3=indirect((concatenate(($bf$1),value($bg$1))))

result is #REF! but the reference itself works!
and if I replace id4.sg3@ by E, the formula works! and return E3

Is there a way to have that done with my reference including the "@"?

thank you for your help
[2020-05-04 17:52:24]
Sawtooth - Posts: 3990
Is there a way to have that done with my reference including the "@"?
Apparently it's not supported to use the ID#.SG#@ reference with INDIRECT
[2020-05-04 18:17:03]
User185210 - Posts: 57
thank you
[2020-05-12 14:00:31]
User185210 - Posts: 57
Hello tomgilb, I try to have two TMS (trade management study),

the first one with "Only modify stop in One direction": NO (when stop of long position is below j9) and another one with "Only modify stop in One direction": Yes, when e3 above j9 and each of them have separate IF...dynamic conditional values... Both TMS have the same acs buton.

My result: fist step works but second one doesn't...The "one direction only" part is not blocked as the conditions change all the time.

Could you help me out?

Thank you
[2020-05-12 14:29:26]
Sawtooth - Posts: 3990
Each instance of the TMS study should reference its own spreadsheet column/subgraph; its formula should return the price you want. IOW, you can't use two instances to control the same stop.

If you want to move the stop up and down until you are in profit, and only trail when you are in profit, set 'Only Modify Stops In One Direction' to No and use a formula that tells the TMS where to move it.

The formula might get tricky, and you might need to use an intermediate calc in another column so that you have a persistent value when in profit, and a dynamic value until you are in profit.
[2020-05-12 15:09:26]
User185210 - Posts: 57
I struggle for the last two weeks with the persistent values and the logic part of it...

What would you recommend using as a "fixed" base for persistent values: j9 and/or j96? or else. So far I am experimenting with j9, j42, j96...and am not satisfied yet with the result?

Another question: I have noticed that since end of last week, when a stop moves and position closes, there is a remaining "Pending stop" displayed but not active and I can't remove it using the "x"! Have you any clue what could that come from? Is it a malfunction of the TMS?, my formula?, New SC2102, my broker API?

Thank you very much for you help
[2020-05-12 16:41:00]
Sawtooth - Posts: 3990
I struggle for the last two weeks with the persistent values and the logic part of it...
The basic format to create a persistent variable in a spreadsheet Formula Column is:
If event, then value, else previous value.
Here are some examples:
Spreadsheet Example Formulas and Usage: Persistent and Incrementing Variables
Spreadsheet Example Formulas and Usage: Return Last Two Zig Zag Reversal Values
Sometimes you need to release the persistent variable with a second IF statement.

What would you recommend using as a "fixed" base for persistent values
You could use a fixed value in the 'then' portion, but not for the 'else' portion. The 'event' portion is a change of state or a change of value from one bar/row to the next.

Another question: I have noticed that since end of last week, when a stop moves and position closes, there is a remaining "Pending stop" displayed but not active and I can't remove it using the "x"! Have you any clue what could that come from? Is it a malfunction of the TMS?, my formula?, New SC2102, my broker API?
Most likely the latter. Check the Trade Service log.
[2020-05-12 17:11:20]
User185210 - Posts: 57
Thank you
[2020-05-13 00:43:58]
User183724 - Posts: 183
just a quick follow up - i found the following works pretty solid and it supports relative column reference and absolute row reference to Study Subgraph

=MIN(INDEX(BU3:BU1002, any supported variable type ,1):INDEX(BU3:BU1002, any supported variable type ,1))


where a calculated MIN (MAX etc) is desired.

INDEX(BU3:BU1002, any variable type ,1) establishes the column the data will be obtained from and the variable can be direct or indirect...

examples

=MIN(INDEX(BU3:BU1002, any supported variable type ,1):INDEX(BU3:BU1002, any supported variable type ,1))

with data coming from column BR3 and BR12

=MIN(INDEX(BU3:BU1002, BR3 ,1):INDEX(BU3:BU1002, BR12 ,1))

or

=MIN(INDEX(ID2.SG1@3:ID2.SG1@1002, BR3 ,1):INDEX(ID2.SG1@3:ID2.SG1@1002, BR12 ,1))

something a little more complex

=MIN(INDEX(BU3:BU1002, ((BS3-BJ3)+1),1):INDEX(BU3:BU1002, ((BS3-BJ12)+1),1))

thx again tim

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

Login

Login Page - Create Account