Current location | Thread information | |
![]() ![]() ![]() ![]() ![]() ![]() |
Last Activity 1/17/2022 3:59 AM 80 replies, 41364 viewings |
|
Printer friendly version |
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Hi All Im trying to develop a trade plan that will see to buy in a reversal - the picture attached show what I intend to do. Enter a trade next day when the current bar crosses the high of previous bar. Needs to be open 5 bars in the future to enter if not the order gets cancelled. I tried to set up a stop limit trade - but for some reason it does not work - it gets reset to limit - and actually it buys at the open next day. Attached is also the trade plan that i tried to set up Thank you in advance for your guidance ![]() ![]() | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Stop Limits currently have some problems. They don't permit Virtual Levels to be set ... there may be some other issues ... so ... Try using a Stop Market with Units set for Points, Quantity set for 0, and Stop Offset set for Above High Prior Bar. Finally, set Periods in Force to 5. I've not tested this but it should work. | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Jim Thank you I tried what you mentioned and did not work - it does not take any trade. Here is the trade plan ![]() | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
How are you using it? In a strategy or manually? | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Within a strategy - do you need a copy? | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Jim - I just send you a copy via mail - many thanks | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
If you'd like to make sure that you only enter on a bar that has an OPEN price higher than the previous bar's High, then create a small #Stop in OLang: #Stop ExitLevel = High if Open > High[1] then Signal=ExitSignal You can use this with a Market order and it should work just fine. It should also work with a StopMarket or Limit order, set for a Virtual Level. That Stop becomes a Condition for the Entry row. [Edited by Jim Dean on 2/25/2010 11:54 PM] | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Jim Sorry for my lack of knowledge in the little Olang below when you have signal = exit signal is this for entry or exit. Basically, I want that when the signal is generate by the strategy as follows: 1) Tonight I see a entry signal from the strategy (Day 0) 2) Tomorrow (day 1)enter trade if price is above high of Day 0 3) If not, do not enter but keep it open 4) Day 2 - price was not above high prior day 5) Day 3 - enter if current price is above prior Day (Day 2) etc. same process until bar 5 Thanks | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
I am trying to finish up a BIG project today that I've been working on with Matt's help, to provide a THOROUGH "dictionary" / explanation for all kinds of things related to STOPS. Please watch for the post, hopefully later today. Quick answer ... don't fret about the word "exit". Think of it as a TRIGGER-condition, that activates the attached Order. [Edited by Jim Dean on 2/26/2010 8:43 AM] | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Thanks for the complete explanation ... that would have been helpful, if presented originally. I can't spend more time on this right now ... sorry. Please fiddle with the OLang code ... your solution lies there. | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Duxx ... I've discovered a piece of info (thanks Matt!) that clarifies the strange operation. If you set up a "level" related to a L, SM, or SL order by using the dropdowns and the input fields on the right side of the pane, then that level does NOT update with each new bar. That is, the level for the Limit Order is established on the FIRST bar ... based (in your case) on the H of the prior (Signal) bar ... and that level remains as-is for as long as that condition-row remains in force. Furthermore, as I mentioned earlier, the Periods in Force is questionable at this time ... Matt is not sure that it is working properly. So ... there are two viable solutions: 1. Just write the code in a OLang #Stop routine, and use a VIRTUAL level with your L or SM input, and that level has the ability to be set at whatever you want, based on bars that come before the bar the level is applied to. A lot more explan is coming with the big writeup. 2. You can also do it without using a #Stop routine. What you need is to set up a second Condition row in the first step, based on an Nbar Stop set to 1, then create another Step just like the first Step, and so forth, for five successive bars. See the attachment for the full picture. [Edited by Jim Dean on 2/26/2010 12:24 PM] ![]() | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Jim, excellent - very greatful Right now, I got an invalid trade plan message - telling me that condition number (2) in step (1) is invalid because you cannot base the stop level on entry level as you are not entered at that point. I eliminated the NBAR line from the step 1 and then it allowed me to save - not sure what is driving this - but will test it out. Thank you ![]() | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Hi, Duxx: Do NOT eliminate any lines ... that will "break" how the thing works. Instead, just change the radio button on the bottom right for all the Nbar exits to "Previous Bar" H/L or Close ... that will elim the error message. | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Ah - that worked and the trade plan was able to save - Ran the strategy again, but still not entering when it supposed to - this trade should have not been taken. ![]() ![]() | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
deleted by Jim [Edited by Jim Dean on 2/26/2010 2:38 PM] | ||
^ Top | |||
Matthew Greenslet![]() Idol ![]() ![]() ![]() ![]() Posts: 2077 Joined: 2/27/2006 ![]() |
Leave everything else the way it is but change the Limit order to a Stop Market order. When buying shares a Limit = SomePrice or Lower. A Stop Market = SomePrice or Higher | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Matt ... thank you. Egg on my face with this one 8~/ Duxx: I'm sorry I did not catch that earlier ... Matt hit it on the nose. Don't feel bad ... it's a mistake that's easy to make (obviously ... I made the same one ;~) [Edited by Jim Dean on 2/26/2010 2:39 PM] | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Matt Thank you - changed to stop market It kind of work for some but not for others... here is one example that did not worked. See attached. ![]() ![]() | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Duxx ... pls be sure your chart includes the YEAR ... which feb is your last attachment for? Its a pain to search | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Oh! Duxx 4 - 2008 Duxx 3 - 2009 Thanks | ||
^ Top | |||
Matthew Greenslet![]() Idol ![]() ![]() ![]() ![]() Posts: 2077 Joined: 2/27/2006 ![]() |
The yellow bars show when a step executes an order or changes steps. So your Pending Signal bar (2 bars to the right of the first yellow line) completed, starting the tradeplan at the open of the New Signal bar (the bar directly after the Pending Signal). The high never hit the high of the prior bar and that bar completes. At the open of the next bar (first yellow line, I will refer to this as Step 1 bar) our NBar exit fires and submits a new Stop Market order for the high of the New Signal bar. Again the high does not cross our level and we repeat this process, drawing a yellow line on the Step 2 bar and entering a SM at the high of Step 1 bar. Note the high of the Step 3 bar (third yellow line) is suspect to being >= the high[1]. I cant tell from the screen shot. However if assuming it is not we should have entered on Step 4 bar at a value = H[1]. and our stop levels become active on this bar. I am not sure what they are but they appear to have fired on the Step 4 bar (Entry Bar, indicated by the vertical line in the vote line, and the exit indicated by the blue X) after the market (daily chart) filling at the open of the Step 5 bar (last yellow line). The little blue box after the blue X (or stop code) indicates a delayed exit. The second signal in the screen shot is correct. It never enters since High >= High[1] is never true. Really you should also see the dashed lines from the first signal drawn out over every bar that the order was in play and then just stop with the next bar blank. The reason being it is important to note those bars because a new signal can not be promoted to the vote line until that tradeplan completes. Just note this for now that if you see another new signal voted UNDER the vote line during 5 bars after your signal that is on the vote line and you are wondering why its not there, its because the tradeplan from the prior voted signal was active during that time. | ||
^ Top | |||
Matthew Greenslet![]() Idol ![]() ![]() ![]() ![]() Posts: 2077 Joined: 2/27/2006 ![]() |
Duxx, Best I can assume from your screen shots is that the order level is not changing from the first bar. Are you sure your NBar virtual conditions are configured correctly? | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Matt Here is the trade plan how was it structured ![]() ![]() | ||
^ Top | |||
Matthew Greenslet![]() Idol ![]() ![]() ![]() ![]() Posts: 2077 Joined: 2/27/2006 ![]() |
I cant currently test due to the state of my testing box, but out of curiosity does the trade plan allow you to use a NBar periods of 0? If so please validate the entries. | ||
^ Top | |||
Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() |
Matt THe system allowed me to input 0 - but on the example Duxx 4 - the trade was not taken at all. It only shows the arrow up for the entry but that's it. Attached is what I see now.... [Edited by Duxx on 2/26/2010 3:27 PM] ![]() |
|
Legend | Action | Notification | |||
Administrator
Forum Moderator |
Registered User
Unregistered User |
![]() |
Toggle e-mail notification |