| Automated Trading Black box systems, strategy automation, algorithmic trading, etc... |
![]() | | Tweet | |
| | #9 | ||
![]() | Re: Easy Language Stop Loss Problem scaling in: If condition3 and Condition4 and MarketPosition = 0 then begin; Sell ("sell") Cts contracts at Market; End; If (Condition3 and Condition4) AND MarketPosition = -1 AND C < EntryPrice-0.0010 then Begin sell ("Sell2") Cts contracts Market; End; If (Condition3 and Condition4) AND MarketPosition = -2 AND C < EntryPrice-0.0010 then Begin sell ("Sell3") Cts contracts Market; End; but id also like to beable to scale out. if for instance the price went above the third order by X amount id like to close it but still keep the remaining 2 open. someone above mentioned NAMING your orders. how exactly would i go about doing this. thanks again for your help | ||
| |
|
| | #10 | ||
![]() | Re: Easy Language Stop Loss Problem Quote:
You've called them: "Sell" "Sell2" and "Sell3" I you want to scale out you need to set a target price and Buy to Cover (for a Short) or Sell (for a Long) at a LIMIT price: Example: Inputs: EXITatTarget (TRUE), Target1Qty(1); vars: EXITPrice(0); // Calc ExitPrice add some logic to calc your exit based on a target or whatever... if Marketposition=-1 and EXITatTarget =TRUE then Begin Sell ("Target1") Target1Qty Contracts total next bar at ExitPrice Limit; end; | ||
| |
|
| | #11 | ||
![]() | Re: Easy Language Stop Loss Problem i was trying to get the following: if marketposition = -2 AND the price of"sell2" < CURRENTPRICE+0.0005 then begin: obviously easy language doesnt like that though + i had a look at EXITprice and it says the following: If last trade exited at 455.75 then ExitPrice(1) = $455.75 im not sure thats what im looking for | ||
| |
|
| | #12 | ||
![]() | Re: Easy Language Stop Loss Problem the definition of exit price i got said it returned the value of the last exit.... if u placed[1] at the end and that it could be used to compute the last 10 prices. im not sure thats what i was looking for. any other ideas?? | ||
| |
|
| | #13 | ||
![]() | Re: Easy Language Stop Loss Problem Example: PRINT Barnumber," Date ",Date," Time ",Time," MarketPosition ",MarketPosition," EntryPrice ", EntryPrice," ExitPrice ",ExitPrice); Then I would consider how to best retain or refer to the value you are looking for. | ||
| |
|
| | #14 | ||
![]() | Re: Easy Language Stop Loss Problem Also, is it possible, or even necessary, to put within the strategy a buy/sellshort order with a pre-set stoploss? Possibly something like: If conditions are met for fast jtHMAavg crosses slow jtHMAavg, then begin; buy/sellshort 100 shares next bar at market; SetProfitTarget(1000); SetStopLoss( 100); end; This is going to be my first time using a strategy for Tradestation, and want to backtest it, haven't tried that and not sure how to figure it in for possible flaws and slippage for backtesting. I'm going to use it on a 2x or 3x Proshares or Direxion index fund, and the position will reverse immediately when the jtHMAs cross on the next bar after the cross, from long to sellshort, or vice-versa. Not sure if that brings more problems, the instant reversal. Thanks for any help. Curtis | ||
| |
|
| | #15 | ||
![]() | Re: Easy Language Stop Loss Problem Inputs: inputa, inputb, inputc; Variables: vara, varb, varc; Condition1: jtHMAavg1[1] > jtHMAavg2[1] Condition2: jtHMAavg1[1] < jtHMAavg2[1] If condition1 then begin; Buy ("buy long") 100 Cts contracts next bar at market; End; If condition2 then begin; sell ("sell short") 100 Cts contracts next bar at market; End; SetProfitTarget(1000); SetStopLoss( 100); that SHOULD be right but i havent checked it in easy language as im just going out but it should give u an idea of how it possibly should look. hope that helps | ||
| |
|
| | #16 | ||
![]() | Re: Easy Language Stop Loss Problem ![]() Did you ever get this to work ? You're forgetting one important statement. I believe the order system is configured for equities by default. you have to specify that you're trading contracts... From the EasyLanguage manual: Quote:
Inputs: StopAmt(1), ProfitAmt(1); SetStopContract; SetStopLoss(StopAmt); SetProfitTarget(ProfitAmt ); | ||
| |
|
![]() |
| Tags |
| profit target, stop loss |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Easy Language Strategy Help | Marc33139 | Automated Trading | 3 | 07-28-2008 12:35 PM |
| Need Assintance with Simple Indikator ( Easy Language ) | flyingdutchmen | Coding Forum | 1 | 06-30-2008 07:32 PM |
| Stop Loss Stop Loss Trailing | rod30 | Beginners Forum | 8 | 02-23-2008 11:49 AM |
| Easy ADE Problem | bigboy | Coding Forum | 1 | 02-08-2008 07:59 PM |
| Easy Language - Help with Simple System | gatrader | E-mini Futures Trading Laboratory | 8 | 12-17-2007 07:40 PM |