Question about MC "Sell" and "BuyToClose" syntax - futures io
futures io futures trading



Question about MC "Sell" and "BuyToClose" syntax


Discussion in MultiCharts

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Question about MC "Sell" and "BuyToClose" syntax

(login for full post details)
  #1 (permalink)
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
 
Sinatra Fan's Avatar
 
Posts: 24 since May 2019
Thanks: 2 given, 6 received

So I've been programming with EASY/POWERlanguage for about 13 years now. And I'm not too proud to say that I'm not a "know-it-all" nor do I pretend to know everything there is to know. With that said, I'm in the process of coding a strategy that adds contracts and takes off contracts during a trade. While thinking of how to do this, I decided to actually look up the keyword "SELL" in the reference guide. In there, I found the following example:

Completely exit from the long position established by the entry labeled "Original
Entry", at Market price on open of next bar:


Sell From Entry("Original Entry")Next Bar At Open;

Sell 10 shares of the long position established by the entry labeled "Original
Entry", at Market price on open of next bar:


Sell Entry("Original Entry")10 Shares Next Bar At Market;

I found this useful but perplexing at the same time. So I must ask the community for clarity. Let's say I put in code that will Buy 20 contracts once the signal tests are met and I call that trade "Original Entry" Then, while that position is open, the strat identifies another condition and buys another 10 contracts that is labeled "Second Position". So now there is a total of 30 contracts open (20 under the label "Original Entry" and 10 under the label "Second Position".) Is MC's example in the reference guide saying that if I want to close all or some of only the contracts in the "Original Entry" position, it will do it with the examples shown? Please confirm.

Also, if the strategy has used this label in prior positions but are now closed out, is this a problem? In other words, can I assume it will only consider the open trades and nothing already closed out?

Thanks for the help.

Reply With Quote

Can you help answer these questions
from other members on futures io?
S&P 500 from 1789 until today: free data
Emini and Emicro Index
Moores Research vs spread software SeasonAlgo
Trading Reviews and Vendors
Pyrapoint by Don Hall information
Traders Hideout
Simulated Playback Trading
EasyLanguage Programming
the link between CFDs brokers and bank spot liquidity?
Currencies
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
141 thanks
How did you learn to trade?
101 thanks
2020 profit and loss results
40 thanks
Finally Turning the Corner, tha "its 80% Psychology" thing...
27 thanks
Is NT8 the right platform for scalping?
26 thanks
 
(login for full post details)
  #2 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,224 since Apr 2013
Thanks: 405 given, 1,466 received

Hello Sinatra Fan,

an exit tied to a specific entry name will only close shares/lots/contracts from entries with that name. If nothing is left to close from that entry it would not affect differently named entries.
In case you have multiple entries open that share the same name an exit like you wrote below would be applied to all entries with the same name. Using the "Total" reserved word in an exit allows you to change that default behavior.

This is a good topic for testing various scenarios on a chart as this should clarify all your questions and show you how you can control the behavior of exits.

Regards,

ABCTG




Sinatra Fan View Post
So I've been programming with EASY/POWERlanguage for about 13 years now. And I'm not too proud to say that I'm not a "know-it-all" nor do I pretend to know everything there is to know. With that said, I'm in the process of coding a strategy that adds contracts and takes off contracts during a trade. While thinking of how to do this, I decided to actually look up the keyword "SELL" in the reference guide. In there, I found the following example:

Completely exit from the long position established by the entry labeled "Original
Entry", at Market price on open of next bar:


Sell From Entry("Original Entry")Next Bar At Open;

Sell 10 shares of the long position established by the entry labeled "Original
Entry", at Market price on open of next bar:


Sell Entry("Original Entry")10 Shares Next Bar At Market;

I found this useful but perplexing at the same time. So I must ask the community for clarity. Let's say I put in code that will Buy 20 contracts once the signal tests are met and I call that trade "Original Entry" Then, while that position is open, the strat identifies another condition and buys another 10 contracts that is labeled "Second Position". So now there is a total of 30 contracts open (20 under the label "Original Entry" and 10 under the label "Second Position".) Is MC's example in the reference guide saying that if I want to close all or some of only the contracts in the "Original Entry" position, it will do it with the examples shown? Please confirm.

Also, if the strategy has used this label in prior positions but are now closed out, is this a problem? In other words, can I assume it will only consider the open trades and nothing already closed out?

Thanks for the help.


Follow me on Twitter Visit my Facebook Reply With Quote


futures io Trading Community Platforms and Indicators MultiCharts > Question about MC "Sell" and "BuyToClose" syntax


Last Updated on December 2, 2020


Upcoming Webinars and Events
 

Journal Challenge!

February
 

Battlestations!

March
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts