Profit Target as Percent Gain - EasyLanguage Programming | futures io social day trading
futures io futures trading


Profit Target as Percent Gain
Updated: Views / Replies:6,857 / 4
Created: by ascr Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

 
 
Thread Tools
 

Profit Target as Percent Gain

 
Toronto
 
 
Posts: 3 since Oct 2010
Thanks: 0 given, 0 received

Profit Target as Percent Gain

Help would be greatly appreciated.
I'm trying to exit a position at a 15% gain using easyLanguage.
Here's the relevant pieces of the code:

condition3 = Price > (EntryPrice * 1.15);
if condition3 then
Sell("LE 15% Gain") This Bar On Close;

 
 
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
 
Toronto
 
 
Posts: 3 since Oct 2010
Thanks: 0 given, 0 received

Answer
This post has been selected as an answer to the original posters question Answer


After poking around I found the solution. I'm rolling the account, so I'm using "initialcapital+netprofit" elsewhere in the code. Here's the relevent code:

variables: x(0);
x = initialcapital+netprofit;
setprofittarget (x * 0.15);

 
 
NYC + NY / USA
 
Trading Experience: Advanced
Platform: "I trade, therefore, I AM!"; Theme Song: "Atomic Dog!"
Favorite Futures: EMD, 6J, ZB
 
kronie's Avatar
 
Posts: 798 since Oct 2009

excellent answer,

I have often wondered how to set a percentage as a target instead of a fixed interval as such

perhaps this can be shown with examples of how to implement it?

thanks

 
 
Gurnee, IL
 
 
Posts: 46 since Apr 2010
Thanks: 17 given, 94 received


kronie View Post
excellent answer,

I have often wondered how to set a percentage as a target instead of a fixed interval as such

perhaps this can be shown with examples of how to implement it?

thanks

I did not really test the following code, but it should put you in the right direction. The code example show two ways of determining a dynamic profit target. The first is based off the current ATR while the second is a percentage gain of current net profit.

 
Code
Input:
    ATRfactor( 2 ),
    ATRLength( 13 ),
    PrcntGain( 15 );
    
Variables:
    ProfitTarget$(0),
    ATR(0),
    MP(0);

ATR = AvgTrueRange( ATRLength );
MP = MarketPosition;

// Enter new trade on golden cross

If ( average(Close, 50) crosses over Average( Close, 200 ) ) Then
    Buy ("Gold Cross") next bar at market
Else If ( average(Close, 50) crosses under Average( Close, 200 ) ) then
    Sell ("Death Cross") next bar at market;
    
If ( MP = 1 ) Then
Begin
    // Set profit based upon Average True Range
    ProfitTarget$ = ATRfactor * ATR * BigPointValue;
    SetProfitTarget( ProfitTarget$ );
End;


If ( MP = 1 ) And ( NetProfit > 0 ) Then
Begin
    // Set profit based upon percent profit
    ProfitTarget$ = ( NetProfit * PrcntGain / 100 );
    SetProfitTarget( ProfitTarget$ );
End;


 



futures io > > > > > Profit Target as Percent Gain
Thread Tools



Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

September
 

The Spirituality of Trading w/Dr Brett Steenbarger

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
profit target strategy on tradestation dirtybird EasyLanguage Programming 3 November 23rd, 2010 12:07 AM
Target Profit Beats Street on Improved Sales Quick Summary News and Current Events 0 August 18th, 2010 08:00 AM
What is the best way to work out your profit target? pyekorn Psychology and Money Management 14 July 22nd, 2010 01:14 AM
where should profit target be placed? anniebee321 Beginners and Introductions 9 June 7th, 2010 07:38 AM
Protecting the cumulative profit target in an automated strategy nanobiotech NinjaTrader Programming 4 April 1st, 2010 11:24 AM


All times are GMT -4. The time now is 07:49 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 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