Hi i'm not a programmer but if someone can help writing a script
here my strategy :
if there is a shooting star and the top of the shooting star is above the top of the top of [bar-1] and [bar-2] or above the top of [bar-1] and [bar-3] or above the top [bar-2] and [bar-3] = selllimit at the opening of the next bar (after the shooting star)
the stop is 3 ticks above the top of the shooting star
the taking profit level :
50% of the position = selling level - (2 times (stop - open position)) (to get a Risk reward of 2)
50% of the position = selling level - (4 times (stop - open position))
sorry for my english.... i'm french !
thx a lot
Size:
Color:
QUOTE:
selllimit at the opening of the next bar (after the shooting star)
Is this a short side setup? Then what's the short entry limit price (e.g. the next bar's opening price?)
Size:
Color:
hi Eugene,
yes this is a short side setup and the short entry limit price is the next bar's opening price.
thx.
Size:
Color:
Hi Eugène,
is it possible to make my strategy with wealth-Lab or it's too difficult ?
Thomas
Size:
Color:
Sure it's possible Thomas, but I could've easily forgot your request as the forum was getting pretty active yesterday. Here's one possible way to go about it, the other would be to employ
SplitPosition:
CODE:
Please log in to see this code.
Size:
Color:
thx a lot Eugène !
Size:
Color:
Hmm wait, that won't be useful in Multi-Symbol Backtest mode - what went through my head? Let me approach it in a different way.
Size:
Color:
Here you go, the amended version suitable for MSB:
CODE:
Please log in to see this code.
Size:
Color:
Hi Eugene
i have this error :
error CS103@(15,4) : Le nom 'CandlePattern' n'existe pas dans le contexte actuel
that means : the name 'CandlePattern' doesn't exist in the current context
thx
Thomas
Size:
Color:
You are trying to copy & paste a fragment of my code inside Execute() to your own strategy without including one of the required references.
Size:
Color:
i'm working only on this first strategy... i copied your code... may be i made a mistake when i made the copy
Size:
Color:
1. You should do much better with the second strategy as it's suitable to run in portfolio backtest mode while the 1st one is not OK.
2. If my clue above didn't help, then you need to include this forgotten line as well:
CODE:
Please log in to see this code.
Size:
Color:
ok i can run the strategy now but that not give me what i want, how can i send you my printscreen ?
Thomas
Size:
Color:
1. Upload your image to any image hosting server
2. Find out the direct link to the image
3. Use the IMG button to paste the URI between a pair of IMG tags:
[ IMG ]your location[ / IMG ] (without spaces)
Size:
Color:
look
click up left to widen the picture
Size:
Color:
Size:
Color:
Yes, I see the problem - let me take a look and fix the bug.
It's only a minor effort on your part to right click a flickr picture, copy the direct URI and insert it into a pair of IMG tags:
QUOTE:
http://farm4.static.flickr.com/3664/3404424470_75bb1ac0e5_o.jpg
Please do that next time, thank you.
Size:
Color:
Meanwhile a question: what if the market opens above the high of the ShootingStar bar (for example, 4 ticks above) - would you skip the trade?
Size:
Color:
yes i skip the trade...
Size:
Color:
Here we go again. The first two drafts were buggy like hell so they should be completely ignored.
Re: "No signal" on your Flickr picture. Please try this code and see if it works for you, as I said there were bugs. Frankly, it's not my part to identify the ShootingStar setup; every time you see it on the chart, it's a job of the
WealthLab.Rules.Candlesticks library - including the fancy highlighting. If it still doesn't show up where it should, we might need to take a look at your data.
Re: "Why it cover here" / "Why it stop here". Fixed!
CODE:
Please log in to see this code.
Size:
Color:
my strategy is working but i have a problem
sometimes, the market does not reach the target and after that i'm stopped... so i think i have to include a strategy of trailing stop
on my strategy...
where can i find a lot of different script of trailing stop...
in my case i would like to include this trailing stop :
if there is a new bottom compare the bottom of my shooting star, move the stop from 3 ticks above the top of the shooting star
to the top of the shooting star...
thx
Thomas
Size:
Color:
That doesn't sound like a complete definition of trailing stop, rather a single adjustment of the level. Anyway, you'll find more on trailing stops in the QuickRef ("Trading" section), if you search for "trailing" in the "Open Strategy" dialog and of course in
WL5 Wiki.
Size:
Color:
and if i just want to adjust a level... as i said :
if there is a new bottom compare the bottom of my shooting star, move the stop from 3 ticks above the top of the shooting star
to the top of the shooting star... and that's it... don't move it after.
Size:
Color:
Then you would need to adjust the RiskStopLevel accordingly.
Size:
Color:
where can i find RiskStopLevel ? on the QuickRef ("Trading" section) ? and where can i find the QuickRef ("Trading" section) ?
Size:
Color:
Put the cursor on a WealthScript function in the Editor and hit F1. Otherwise hit F11 to launch the QuickRef and use the Search to find a keyword.
Size:
Color:
ok i read the QuickRef and i made my trailing... but where is my fault ?
here my trailing stop wanted = when the market reach a RR of 3 the moving average become the stop (i mean when the market cross to the upside the moving average, the system cover the short)
here my script :
CODE:
Please log in to see this code.
watch the result :
Size:
Color:
First,
CODE:
Please log in to see this code.
QUOTE:
It should trailing me stop this candle..
I'm sure it's correct for your conditioning, but you didn't tell us what ssPrice is. In other words, removing the "if" condition would for sure cause the stop to execute where you indicated, but the condition is preventing that signal from executing at that time.
Size:
Color:
1)
ssPrice is always 0 at the time you call it. It's declared on the bar before entry is made.
2) Don't use bar+0 aka bar: it's peeking.
Bars, Loops, and Bar + 1If my understanding is correct (untested):
CODE:
Please log in to see this code.
Size:
Color:
Hi Cone, ssprice is the top of my candle give me the signal to sell... that give me a stop 3 ticks above my candle...
i tried to remove the 'if' and it doesn't work...
Eugene i'm sorry but i make my system with only one position for the moment... sorry
here my code... only my trailing stop doesn't work :
CODE:
Please log in to see this code.
Size:
Color:
what's wrong on my trailing stop script ?
watch the result
Size:
Color:
Remove this line from your code -
CODE:
Please log in to see this code.
That's the problem.
Size:
Color:
yeah but when i remove this line, the condition to use the moving average as the trailing stop only after reaching the RR2 is removed...
Size:
Color:
or a RR of 3
Size:
Color:
But it's the problem! I've already said this, but the Trailing Stop function can only work if it's executed and that condition is not allowing it to execute.
Why? Because it's returning "false" where you think the stop should exit the trade.
Why is it returning false? All the values of the variables in that condition are pretty clear except for stop. If you find out what stop is, then you'll know what the problem is. This is your code... time to troubleshoot it.
Size:
Color:
when you said that the
stop is not clear, this is only on this script line :
CODE:
Please log in to see this code.
and how can i define the condition 'if you reach a RR of 3, watch the moving average as the trailing stop'
Size:
Color:
Use my latest code for example:
CODE:
Please log in to see this code.
Size:
Color:
i will try but i don't understand where you define 'limit3hit'
Size:
Color:
At the time of entry. See the same strategy code, below.
Size:
Color:
and should i start my script with the trailing stop and finish it with the condition of entry level ?
like you did on the script above the 4/14/2009 4:54 PM ?
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
Hi engene, that almost work... the only thing is that it trailing me stop at the moving average only when the bar-1 is below the limit of the RR3... i would like that the system use the trailing stop when the market hit the rr3... even if the market cross the moving average two, three etc bar after... i tried to remove the bar+1 in this line :
CODE:
Please log in to see this code.
but it doesn't work
it's maybe clearest with the picture...
Size:
Color:
PS : thx to integrate the color... that's really fantastic !
Size:
Color:
QUOTE:
i would like that the system use the trailing stop when the market hit the rr3... even if the market cross the moving average two, three etc bar after...
This is what I suppose this code is exactly doing: once the RR3 level is hit, it trails the stop at the SMA level on that bar and will exit when this level is breached.
QUOTE:
i tried to remove the bar+1 in this line :
This will lead you nowhere. If you understand the purpose of
bar+1 in that line, how could you remove that mandatory parameter?
Size:
Color:
but it doesn't work, because in the first case (on the picture) i'm not stop on the moving average even if the market hit the RR3 limit... how can i replace bar+1 by all the bar after hiting the rr3 ?
Size:
Color:
You should
not replace bar+1 with anything. Read this KB article again to understand why:
Bars, Loops, and Bar + 1QUOTE:
i'm not stop on the moving average even if the market hit the RR3 limit
I seem to have implemented that twist:
CODE:
Please log in to see this code.
Here's the 5-minute Eurex Bund data for 01/Apr/2009, as you see the Strategy will now cover on a CrossOver even if the price is above the RR3 limit:
Size:
Color: