[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Help with Exploration please



PureBytes Links

Trading Reference Links

Terry 
 
Thanks for your prompt response. There is only one thing better than this product and that is the enthusiastic involvement and sharing of ideas in this group.
 
Your solution has helped me understand another aspect of the stop function and I will certainly play with it.
 
What I am doing is trying to develope a system along the lines of V K Tharp in TYWTFF. 
 
First step is to look at entries only, and see if one can create entries that give better than even chance of winning, across my chosen markets across all time frames.
 
Thereafter adding the stops and other exit conditions: this may reduces one's win ratio.
 
Interesting your simple formula varies win ratio from around 25% on the XAO with good returns using 20 period, to around 70% on my own index of stocks also using a 20 day "stopdays". This is on the last 200 periods.
 
The win ratio and profitability vary greatly with these simple parameters so I will continue to look for other entries: I am looking for low risk entries, low to moderate profits with smooth equity curve.
 
Thanks again
 
Chrisb

Terry <MagicTH@xxxxxxxxxxx> wrote:
Chrisb,

I made some notes in your code below attempting to fix your problems.

Instead of all that, how about trying ApplyStop after N bars and optimize on
N bars? (bars = days on daily data) It won't display percentages exactly,
but it will tell you which number of days makes more money, has lower
drawdowns, etc. Check help on Optimize and ApplyStop for parameter usage.

stopdays = Optimize("Stopdays",5,5,20,5); //Test exits at 5, 10, 15, 20 days
ApplyStop(stopTypeNBar,stopModePoint,stopdays,0,False,5);
//Exit at above periods. Do not re-enter same stock for 5 days.

Put the code after your Buy/Sell conditions.

Terry
--

> Greetings All.
> 
> Here is what I want to do:
> 
> 
> Test buy signals only, to see what percentage of the time the price is up
> after 5 days, 10 days, 20 days etc.
> 
> I want to set a buy condition, for example, a simple crossover,
> Then create an exploration for
> 
> a)     date of buy signal ( first line works)
> b)     Value of Open on the next day.(this line gives close of signal day: how
> to get open of the next day?)
> c)     Date for 10 periods from entry. (how to code for this?)
> d)     Close value on day 10 after entry.( I am totally lost here).
> 
> 
> Using code from the help file and yahoo groups. So far I have:
> 
> F1 = Cross(EMA(C,10), EMA(C,30));
> 
> Lastbar = BarIndex()==BarCount-1;//what does this mean in english?
Sets variable Lastbar to True when the current day is equivalent to the last
day of data. This accomplishes nothing in Explore as it is only true on the
last day of data in your database.
> 
> Condition = F1;
> Condition = ExRem(Condition,Lastbar);
Because Lastbar is only true for today, this is doing anything either
> 
> Filter = Condition;
> 
> Buy = F1;
> Sell = 0;
> 
> 
> 
> AddColumn(ValueWhen(F1,DateTime()),"ema Xover",formatDateTime);
> AddColumn(ValueWhen(F1,C), "Open next day",1.2);
You need to use the Open here...(F1,O) instead of (F1,C)

> //AddColumn( BarIndex(5), "date of buy plus 5 days",formatDateTime);
> AddColumn(ValueWhen( F1,C, 5),"C @ B +5", 1.2);//returns blank column
I'm not sure ValueWhen is valid for AddColumn. You can compute gains in your
code and just display them here...or use my first suggestion.
> //AddColumn( ?, "per change from buy",
> 
> 
> 
> Help or references appreciated
> 
> TIA
> 
> Chrisb



Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 


Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
  
   To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


		
---------------------------------
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/