NexusFi: Find Your Edge


Home Menu

 





Sell Shares from 2 positions


Discussion in EasyLanguage Programming

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




 
Search this Thread

Sell Shares from 2 positions

  #1 (permalink)
jessehhhh
Montclair
 
Posts: 17 since Nov 2018
Thanks Given: 0
Thanks Received: 0

I am looking to find the easylanguage code that will allow me to sell shares from 2 different entries.

For example:

I have 2 long entries and at a certain point I want to sell half of my entire position ( the combined shares from both strategies). The only way I have found to do this is put in 2 sell orders and effectively sell the position twice and pay double commision

Is there a way around this?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Could it be that currency futures are way easier to trade?
Currencies
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628


jessehhhh,

take a look at the reversed word "total" as this can be used to accomplish what you have in mind.

Additionally the Advanced Example Strategies in the below topic might be helpful for you:
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=112094

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #4 (permalink)
jessehhhh
Montclair
 
Posts: 17 since Nov 2018
Thanks Given: 0
Thanks Received: 0

I tried that and it still didn't work.

The end of my code was "Sell Total Currentshares*.5 next bar at...

It still only sold from one of the positions.

Am I using this word wrong?

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

jessehhhh,

can you post code that can be used to reproduce what you are seeing?

Did the exit close out half of your entire position?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #6 (permalink)
jessehhhh
Montclair
 
Posts: 17 since Nov 2018
Thanks Given: 0
Thanks Received: 0

I don't have access to it currently but can later.

When i use that exit code it sells half of my first position only. For example if I bought 10 shares in my first entry and 10 in the second, that code sells 5 shares.

If this isn't enough info I will post my code later for help.

Thank You

Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

jessehhhh,

yes, the code should provide more insights into why this is not working on your end.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #8 (permalink)
jessehhhh
Montclair
 
Posts: 17 since Nov 2018
Thanks Given: 0
Thanks Received: 0

After doing some digging on the Forum link you sent me I found out that it is not possible to do in an automated way.

In order for you to have 1 exit instead of to I need to turn on Adopt the real-world position in the Automation tab. However this has to be done after a position is entered and the chart needs to be refreshed which is not viable for my strategy.

Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

jessehhhh,

it sounds like the entries are on different charts or not by a strategy on one chart (like a manual entry and one strategy exit). In that case it's correct that one strategy would have to be made aware of the entire position first.

One way to approach this might be to combine the two strategies into one and apply it to one chart only.

Regards,

ABCTG

Follow me on Twitter Reply With Quote




Last Updated on November 8, 2018


© 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