[amibroker] Re: Apply stop selectively working

 

I'll move this to private e-mail after this message, feel free to e-mail me at brandon.richard03@yahoo.com

I'm trying to wrap my head around it as theirs a lot going on here.

First issue is that ExRem and AllowSameBarExit, according to that e-mail won't work together.

Second issue, is it possible to find a duplicate trade to this. The first blue trade was kind of on its own and had a clear sell signal with the stop.

The yellow trades, the prior 2 trades worked, but they we're working off the Sell variable and not the stop. They weren't same bar, but they are overlapping .


As for the 2nd past post "i think i may be asking Amibroker to do something that it's not capable of IE : having trade 1 open, and on the next bar open enter another trade, but then exit trade 1 on the close of bar 2. leaving trade 2 open"

It's doing this as far as I can see, the two previous trades before the yellow highlighted performed as you wanted.

I'd try to maybe isolate that one bar, see if the "ApplyStop" and Entry will perform correctly on that single bar. I can't see any other same bar entry/exits to see if its working in the picture.

And I just had a brainfart. Every example there on that trade list and drawing has a buy and sell signal. That last bar you want the stop to work on has two sell signals the Stop and the Sell. I'm not sure if that's possible for amibroker to process.

So what it looks like is that the prior open trade gets the sell signal priority, and since backtestregular matches buy and sell signals, the new entry is left hanging without a sell signal. So then the trade is kept open, and moves onto the next bar, then the stop is applied and the stop is based off ValueWhen(Buy,ref(l,-1),1);

ValueWhen() in manual says that it returns an array, the last time condition was true. Well since the trade was moved to the next bar, the last time buy was true is that down bar at the edge of the yellow circle. So now condition is true and its referencing the low of the previous bar as a stop. Which it did It exited at the low of the bar where  you wanted it to stop originally.

Now do I know how to solve this.... not off hand lol. I'm just a second set of eyes here, I think your more familiar with AFL then myself. .

I'm not familiar with the different backtesters I thought MultiRaw might work but I think that will just end up building long positions until a sell signal and it will all sell ruining your system.

Only idea I have (I've never experimented with it) is to somehow get it to look at higher frequency data point so it can have two bars to reference for a close. TimeFrameExpand().

I can see this getting complicated fast for myself. As far as a backtest goes, you could possibly reference the next bar and see if its lower if you have a position open.

IIf(ValueWhen(Buy,Ref(L,1),1) < Ref(Low,-1),TrueArray,FalseArray); It is forward bias but as a backtest it shouldn't effect results, if this is for live algorithm it be an issue. But if this is just a manual system you could manage this yourself.

Now the problem is to get the TimeFrameExpand() and come back with some arrays to fill in the Iff().

I'm not even sure if this would work  or how complicated you want to get into it.

Just some random ideas maybe or some guidance.  Like I said if you want to discuss some ideas, e-mail me. Keep the boards clean. I enjoy these issues as it seems to help me grasp afl better then just trying to come up with some random idea. Usually my random ideas don't get complex enough because I'm not familiar with AFL and its capabilities.

So the options as I see it.
1. Theirs some way to allow 2 exits for 2 trades on one bar.
2. Things get complicated with that "maybe" not even right wall of jargon I wrote above, but who doesn't enjoy a challenge sometimes lol.
3. Or maybe you apply this system with re entry delays, so theirs no possibility of having two sell signals on one bar  and use it across a batch of currencies. I'm not sure what the system is, maybe it was built around that particular pair, maybe spreading it around multiple currency pairs will give you enough trades but ignore conflicts like this in a backtester. I mean with a large enough sample of trades with a good report,  you could manually manage these conflicting issues. If this system was something you plan on manually entering, you could manage more trades and know which ones are which. If its something your looking to go automated with, this option won't work if you want all the signals.

Sorry for any typos or poor sentencing, late night.

__._,_.___

Posted by: brandon.richard03@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (10)

Check out the automatic photo album with 1 photo(s) from this topic.
stops.png

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon