NexusFi: Find Your Edge


Home Menu

 





Distinguish a Long from a Short Position


Discussion in TradeStation

Updated
    1. trending_up 2,596 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
tradestation18
Porto Portugal
 
Posts: 16 since May 2018
Thanks Given: 1
Thanks Received: 1

Is it possible to distinguish if a position is Long or Short ? I wanted to code a different strategy whether the open position is long or short.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Kharg Island at 6%, Regime Fall at 1.5% -- The Black Swa …
Prediction Markets & Event Contracts
More Than Capable: Hegseths War Warning Validates $114M …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
 
teamtc247's Avatar
 teamtc247 
Fairburn, Georgia
 
Experience: None
Posts: 980 since Dec 2012
Thanks Given: 644
Thanks Received: 1,116


tradestation18 View Post
Is it possible to distinguish if a position is Long or Short ? I wanted to code a different strategy whether the open position is long or short.

Your question is vague. How are you deciding to be long or short?


Process oriented goals #1.
Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 choke35 
Germany
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,622 since Feb 2013
Thanks Given: 5,101
Thanks Received: 6,558



tradestation18 View Post
Is it possible to distinguish if a position is Long or Short ? I wanted to code a different strategy whether the open position is long or short.

Assuming you are using TS and that you are just interested in the syntax, you need

MarketPosition(Num)

with Num: number of positions ago

E.g.:
Mypos = MarketPosition(2); {returns 1 if MarketPosition 2 positions ago was long; -1 if short; 0 if flat}

Regarding the current position that means:
Currpos = MarketPosition(0); {returns 1 if the current MarketPosition is long; -1 if short; 0 if flat}

P.S.:
You can download the searchable EasyLanguage PDF Reference here:
https://uploads.tradestation.com:443/uploads/EasyLanguage-Functions-and-Reserved-Words-Reference.pdf


Reply With Quote
Thanked by:
  #4 (permalink)
tradestation18
Porto Portugal
 
Posts: 16 since May 2018
Thanks Given: 1
Thanks Received: 1


teamtc247 View Post
Your question is vague. How are you deciding to be long or short?

Yes, the idea is decide an order depending on being Short or Long. So if I am Long then IŽll move to a strategy A but if I am Short I move to a strategy B.
Thanks


Reply With Quote




Last Updated on September 21, 2020


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts