NexusFi: Find Your Edge


Home Menu

 





Code conditions to close a long position


Discussion in TradeStation

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




Closed Thread
 
Search this Thread

Code conditions to close a long position

  #1 (permalink)
ruliann
France
 
Posts: 3 since Dec 2013
Thanks Given: 0
Thanks Received: 0

Hello everybody

I m wondering how to code "exitlong" or "exitshort" conditions.
Below, you can see my extrait of my code (which doesn't work...)

 
Code
// exitlong conditions

If (Marketposition = 1) then begin
Sell currentbar at entryprice+5 ;
end;
setstoploss (-5);
As soon as a long (buy) position is open (order n°1), I would send two another orders :
order n°2 => it would be placed to "myentryprice + 5 ticks" (with limit order and on the current bar)
and
order n°3 => it would be placed to "myentryprice - 5 ticks" (with market order, a kind of stoploss...)
and "if current price = myentryprice + 2 ticks" then the order n°3 is going up to this level.

Anybody have an idea please?


Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

ruliann,

I'll answer your question in the first thread you created and maybe @Big Mike can close this one as it is a duplicate.

Regards,
ABCTG

Follow me on Twitter
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,663




Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal
Thanked by:

Closed Thread



Last Updated on March 20, 2014


© 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