Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
So I am pyramiding/ buying at specified intervals. It seems as my trailing profit/set break even is being triggered for ALL the "current shares." I.e. one share breaks even or hits it's trailing profit then all of the shares are closed out.
I'm trying to code it to where each individual buy has its own trailing profit/break even (not if one share breaks even, it closes all my positions).
I'm thinking I might be able to accomplish this by having multiple windows open and running each buy on its own workspace, but seems like there might be an easier way.
Any help would be greatly appreciated!
Thanks,
Ryan
Can you help answer these questions from other members on NexusFi?
Your method won't work, mainly because the servers don't care about charts, strategies, or anything other than the trade commands sent to it from the platform. You can deal with this in your code by using stop orders and specifying the number of contracts.
First, take a look at the _StpOrLim strategy. It may have some code to get you on your way.
There are a number of ways to scale out. Here is one idea:
Thank you!! What is scaleout? I can't find this reserved word / function in easy language documentation.
Thanks,
Ryan
'ScaleOut' refers to my variable names. In the example code I shared, you would need to specify your condition for scaling out of a position (profit target, points, etc.). For example, if you have three contracts of ESZ20, you might want to exit one contract when you hit a profit target of $250. You can use the ContractProfit function to do this:
// borrowed from TradeStation documentation
If ContractProfit >= 250 Then
Sell 1 contract This Bar on Close;
Look at the help for this function, as they discuss using it to scale out of a position.