Support Board
Date/Time: Thu, 16 Jan 2025 04:43:18 +0000
[Programming Help] - Help with IF statement in SpreadSheet
View Count: 2013
[2017-10-12 16:21:20] |
User_ML - Posts: 17 |
Am trying to do an "IF" statement in SpreadSheet "J26" Order Quantity. =IF(ID37.SG8@3>E3) {IF($E$3>ID37.SG13@3,2,1)}) trying to say If open = 2 change to 1 unless price is above/below a certain price. Thank You PS This is driving me nuts. |
[2017-10-12 17:04:52] |
traderacefly - Posts: 57 |
I'm not able to test this but try it and see: =IF(ABS(J8)=0,2,IF($E$3>ID37.SG13@3,1,0)) Checks J8, if position is 0 sets to 2 else sets to 1 if current price is > than ID37.SG13@3. ***You may need to change the last 0 to 2 so that is always defaults to 2. Hope that helps Date Time Of Last Edit: 2017-10-12 17:06:44
|
[2017-10-12 17:10:39] |
User_ML - Posts: 17 |
Seems to work. Thank You |
[2017-10-12 17:27:07] |
User_ML - Posts: 17 |
Still not what I am trying to do. Want an IF statement to evaluate the open contracts. 1- if J8==,2 or if J8 =2 then 1 if price is positive to entry, that way if trade is not working stop will hit for 2 not 1. Need to do it for +2 and -2 contracts. The statement works by itself but whe I try to string together a few of the IF's get error??
|
[2017-10-12 18:51:49] |
traderacefly - Posts: 57 |
Sounds like you are talking about the Scaling In/Out feature. Take at look at these: Attached Orders: Scaling In Attached Orders: Scaling Out |
[2017-10-12 19:02:20] |
User_ML - Posts: 17 |
Thank You, but that is with attached orders. Was trying to program it in spreadsheet. But will go over it to see if it does what I am looking for. |
[2017-10-12 19:22:18] |
traderacefly - Posts: 57 |
Attached orders can work with the spreadsheet trading. That is what I do. I'm sure Sierra Chart can do whatever you need. Just a matter of figuring out how. tomgilb is the resident spreadsheet expert here. He also has a website where you can contact him: http://www.sawtoothtrade.com |
To post a message in this thread, you need to log in with your Sierra Chart account: