NexusFi: Find Your Edge


Home Menu

 





Distinguish a Long from a Short Position


Discussion in TradeStation

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




 
Search this Thread

Distinguish a Long from a Short Position

  #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?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Futures True Range Report
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
22 thanks
The Program
20 thanks
GFIs1 1 DAX trade per day journal
19 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,668 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/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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts