I’m having trouble trying to mark a trade entry (within a code) so I can track the highest or lowest the price has gone since my trade entry.
Highest(high,[x]) or Lowest(low,[x])
Basically I either need x=1 today, then x=2 tomorrow, x=3, etc. somehow, however I run into a “only constants expected” error trying to place a variable in where [x] (the expected constant) goes.
Or if it’s possible to maybe plot a vertical line on my trade date then track the highest(high, (from vertical line)).. I think I’m at a dead end and could use some help.
Also I have a (countTradingDays) issue that arose from this issue but will post that in another question to keep this question relevant to Highest, and Lowest incase others run into this same issue.
The type of trading I do primarily is swing and long term .
My logic adjust my exit criteria based on the unrealized profit since I entered the trade.
So as an example if i enter a trade today with minimal unrealized gains over the first few days I may employ a standard trailing or volatility type stop .
However if the trade becomes highly profitable I could change my exit criteria or strategy based on my unrealized profits. As an example if I have a gain of 30% I might tighten my stop parameters or if a volatility stop change my parameters .
To do that I need to understand the highest high since I entered the trade.
Hopefully this helps and thank you all in advance for any suggestions or information you might provide.
Thanks in advance for any help in this issue.
Highest(high,[x]) or Lowest(low,[x])
Basically I either need x=1 today, then x=2 tomorrow, x=3, etc. somehow, however I run into a “only constants expected” error trying to place a variable in where [x] (the expected constant) goes.
Or if it’s possible to maybe plot a vertical line on my trade date then track the highest(high, (from vertical line)).. I think I’m at a dead end and could use some help.
Also I have a (countTradingDays) issue that arose from this issue but will post that in another question to keep this question relevant to Highest, and Lowest incase others run into this same issue.
The type of trading I do primarily is swing and long term .
My logic adjust my exit criteria based on the unrealized profit since I entered the trade.
So as an example if i enter a trade today with minimal unrealized gains over the first few days I may employ a standard trailing or volatility type stop .
However if the trade becomes highly profitable I could change my exit criteria or strategy based on my unrealized profits. As an example if I have a gain of 30% I might tighten my stop parameters or if a volatility stop change my parameters .
To do that I need to understand the highest high since I entered the trade.
Hopefully this helps and thank you all in advance for any suggestions or information you might provide.
Thanks in advance for any help in this issue.
Last edited by a moderator: