| Automated Trading Black box systems, strategy automation, algorithmic trading, etc... |
![]() | | Tweet | |
| | #1 | ||
![]() | Easy Language Stop Loss Problem I'm just starting to learn Easy Language, yet am having problems with stop loss setting when testing strategies. Although the stop loss is set in the code, it seems it isn't always acted upon. Not sure what I'm doing wrong... any ideas most appreciated! Code sample: if Condition11 and Condition12 then begin Buy 1 contracts next bar at market ; SetProfitTarget(3000) ; SetStopLoss( 100); end; In the most recent test, the first trade closed $100.78 down, the second is $16,091 down and still open! Ideally I'd like to set a pip based stop loss (that works!), but it doesn't seem clear how to do this looking at the docs... Thanks! | ||
| |
|
| | #2 | ||
![]() Join Date: Nov 2007 Location: boonies Posts: 1,178 Thanks: 299
Thanked 299 Times in 213 Posts
Blog Entries: 104 | Re: Easy Language Stop Loss Problem SetProfitTarget(3000) ; SetStopLoss( 100); outside the block? | ||
| |
|
| | #3 | ||
![]() | Re: Easy Language Stop Loss Problem Quote:
the code should read like this: if Condition11 and Condition12 then Buy 1 contracts next bar at market ; SetProfitTarget(3000) ; SetStopLoss( 100); Cheers Blu-Ray
__________________ “ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google | ||
| |
|
| | #4 | ||
![]() | Re: Easy Language Stop Loss Problem However, I'd sincerely hope that doesn't work, otherwise I'm questioning the language designers competancy! Surely the idea of a code block is that the entire contents of it get executed when the conditions are met?! I don't want to be setting stop losses etc unless the order has been executed, although I suppose it makes little difference... Enough ranting, I'll try it out, cheers! | ||
| |
|
| | #5 | ||
![]() | Re: Easy Language Stop Loss Problem Quote:
It will work, the fault in the code is that Easy Language will only read that block of code if Condition11 and Condition12 are true. So it will read it at the time of execution.. but in a couple of bars time, for example, Condition11 and Condition12 are false it will therefore not read that block of code. Also "SetStopLoss" will only come into force if a Position is filled. Hope this helps Blu-Ray
__________________ “ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google | ||
| |
|
| | #6 | ||
![]() | Re: Easy Language Stop Loss Problem I think I must be misunderstanding how the stop loss code works then - I assumed at the time of the order being placed, the stop would be associated with the order. Looking at the code, that clearly can't be the case, as the stop loss command doesn't reference the order. I'm now slightly confused how to open multiple orders, and have different profit and stop values for different orders! Is this possible? Is it possible to link the profit / stop commands to the order? | ||
| |
|
| | #7 | ||
![]() Join Date: Nov 2007 Location: boonies Posts: 1,178 Thanks: 299
Thanked 299 Times in 213 Posts
Blog Entries: 104 | Re: Easy Language Stop Loss Problem Quote:
![]() Then re multiple orders and linking exits to that position you can name posititions and use the names in the exits and / or you can use reserve words like SetStopContract and / or run separate / stand alone exit strategies and / or ... hth... this post only cost me $3000 so far... | ||
| |
|
| | #8 | ||
![]() | Re: Easy Language Stop Loss Problem Quote:
Is that not the case? Or does that not work with back testing? Cheers, David. | ||
| |
|
![]() |
| 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 |