| Automated Trading Black box systems, strategy automation, algorithmic trading, etc... |
![]() | | Tweet | |
| | #9 | ||
![]() | Re: EL Code Doubt Quote:
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. | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
rajatheroyal (09-09-2009) | ||
| | #10 | ||
![]() | Re: EL Code Doubt 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... and replace netprofit by positionprofit(0) Code: if positionprofit(0) > myTarget then { exit and stop strategy } | ||
| |
|
| | #11 | ||
![]() | Re: EL Code Doubt plot1(Close*getpositionqu antity(GetSymbolName, GetAccountID) - prevclose*getpositionquan tity(GetSymbolName, GetAccountID), "Days profit"); This is based on TS8.6 (build 2612). Charlton | ||
| |
|
| The Following User Says Thank You to Charlton For This Useful Post: | ||
rajatheroyal (09-10-2009) | ||
| | #12 | ||
![]() | Re: EL Code Doubt 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; | ||
| |
|
| The Following 2 Users Say Thank You to swansjr For This Useful Post: | ||
Charlton (09-10-2009), rajatheroyal (09-10-2009) | ||
![]() |
| Thread Tools | |
| Display Modes | 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 |