Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Reply
Old 09-09-2009, 08:39 AM   #9

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,778
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: EL Code Doubt

Quote:
Originally Posted by rajatheroyal »
Thanks for the idea.I myself live in a developing country 500$ is a big sum in our country.My whole trading capital is just 8 times the donation u people pay for developing countries
i have not spent 500$ for my own education.
Just keep guiding like this no need to code for me .

I am very happy to help anyone who wants to help himself.

Make sure you have downloaded and read the free manuals, there are lots of useful examples in those pages.



p.s. I give more help to people who contribute to this TradersLaboratory community.
__________________



Only an idiot would reply to a stupid post

Last edited by Tams; 09-09-2009 at 09:15 AM.
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
rajatheroyal (09-09-2009)
Old 09-09-2009, 10:41 AM   #10

Join Date: May 2008
Location: amsterdam
Posts: 114
Ignore this user

Thanks: 25
Thanked 38 Times in 30 Posts

Re: EL Code Doubt

@ rajatheroyal

i am not sure if closedequity and openequity are reserved words
in tradestation but in my software it could look like this

Code:
inputs: myTarget ( 200 );

if date > date[1] then value1 = closedequity;

if openequity - value1 <= myTarget then...
another possebility is using Tam's example from post #2
and replace netprofit by positionprofit(0)

Code:
if positionprofit(0) > myTarget then { exit and stop strategy }
flyingdutchmen is offline  
Reply With Quote
Old 09-09-2009, 11:18 AM   #11

Join Date: May 2008
Location: London
Posts: 44
Ignore this user

Thanks: 26
Thanked 21 Times in 15 Posts

Re: EL Code Doubt

Here's an indicator plot that shows profit for the day based on close of previous session and current bar close, ignoring any transaction costs.

plot1(Close*getpositionqu antity(GetSymbolName, GetAccountID) - prevclose*getpositionquan tity(GetSymbolName, GetAccountID), "Days profit");

This is based on TS8.6 (build 2612).

Charlton
Charlton is offline  
Reply With Quote
The Following User Says Thank You to Charlton For This Useful Post:
rajatheroyal (09-10-2009)
Old 09-09-2009, 10:53 PM   #12

swansjr's Avatar

Join Date: Oct 2007
Location: Gurnee, IL
Posts: 282
Ignore this user

Thanks: 86
Thanked 132 Times in 69 Posts

Re: EL Code Doubt

Here is a start.

Code:
Input:
   Day_Loss(500),         // Maximum risk ($) per day
   Profit_Target(600);
    
Variables:
   intrabarpersist Trade_Flag(false),  // Enable/Disable trading flag
   PLB4Today(0),          // P&L total before today
   ProfToday(0),          // P&L total for today (NP + OPP - PLB4Today)
   OPP(0),                // Open Position Profit
   NP(0);                 // Net Profit + Open Position Profit

   If ( date <> date[1] ) Then 
   Begin
       PLB4Today = NetProfit;
       Trade_Flag = true;
   End;

   // Track Today's P&L

   NP = NetProfit - PLB4Today;
   OPP = OpenPositionProfit;
   ProfToday = NP + OPP ;

   If ( ProfToday <= -(Day_Loss) ) OR ( ProfToday >= Profit_Target ) Then 
   Begin
       Trade_Flag = false;
       SetDollarTrailing(0);
   End;

   If ( Trade_Flag ) Then
   Begin
          // TRADE LOGIC HERE
   End;
swansjr is offline  
Reply With Quote
The Following 2 Users Say Thank You to swansjr For This Useful Post:
Charlton (09-10-2009), rajatheroyal (09-10-2009)
Old 09-10-2009, 10:13 AM   #13

Join Date: Jan 2009
Location: tiruchendur
Posts: 38
Ignore this user

Thanks: 51
Thanked 1 Time in 1 Post

Re: EL Code Doubt

Thank u all guys for helping me.
rajatheroyal is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
EL Code Doubt rajatheroyal Automated Trading 11 08-04-2009 06:40 PM
What EL Code Should I Use ? emptyvault Coding Forum 4 07-01-2009 10:08 AM
ADE Code karsat Coding Forum 0 03-08-2009 08:06 PM
P&F Code point-figure Coding Forum 0 02-17-2009 06:24 AM
Help To Code My EA pepe1 Coding Forum 0 06-24-2008 01:41 PM

All times are GMT -4. The time now is 10:47 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.