NexusFi: Find Your Edge


Home Menu

 





Coding for a partial profit


Discussion in EasyLanguage Programming

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




 
Search this Thread

Coding for a partial profit

  #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?
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
23 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 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


© 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