NexusFi: Find Your Edge


Home Menu

 





Coding for a partial profit


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
 arjfca 
Montreal, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: Interactive Broker
Trading: Forex
Posts: 263 since Sep 2010
Thanks Given: 440
Thanks Received: 91

Hello and Happy New Year to all

- Is it possible to capture the actual profit of a position or I need to calculate it using the actual price and the price of entry?

- Using Multicharts (TradeSation), how can i code for a partial profit stop loss?

I'm in profit and the actual profit is more than my 2X my initial risk . If I want to protect half of my actual profit, how can I code it?

Any input trully appreciated.

Martin


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
Jeff65
Gurnee, IL
 
Posts: 46 since Apr 2010
Thanks Given: 17
Thanks Received: 97


Is this what you had in mind? It will start a trailing stop 30% from your live position equity once 2*Risk in profit is reached. Compiled under TradeStation 9.0

 
Code
Variables:
   ProfitTrigger$(0), // The amount of profit need to trigger trailing stop
   PctTrailing(30),   // Percent to trail
   Risk$(0);          // The risk in dollars for the given trade
   
   // Let Risk = dollars risked on your trade
   // Then set ProfitTarget = 2 * Risk$
   // Then use SetPercentTrailing
   
   SetStopPosition;
   SetPercentTrailing( ProfitTrigger$, PctTrailing ) ;

arjfca View Post
Hello and Happy New Year to all

- Is it possible to capture the actual profit of a position or I need to calculate it using the actual price and the price of entry?

- Using Multicharts (TradeSation), how can i code for a partial profit stop loss?

I'm in profit and the actual profit is more than my 2X my initial risk . If I want to protect half of my actual profit, how can I code it?

Any input trully appreciated.

Martin


Reply With Quote
Thanked by:




Last Updated on January 11, 2011


© 2026 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 - Downloads - Top
no new posts