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

[amibroker] Re: Finding next day signals



PureBytes Links

Trading Reference Links

SetOption("PriceBoundChecking", True) doses't really work like it's
suppose to do.   That would be a nice future feature of Amibroker to
have actually.

I like to enter a trade NOT at the open or close of the next trading
day but with a certain price level.   I like the backtester to
eliminate those trades that wouldn't go through of course.   Any help
would be greatly appreciated..

Three



--- In amibroker@xxxxxxxxxxxxxxx, "Andy" <senft@xxx> wrote:
>
> Okay, I think I'm getting closer thankful to the Yahoo Search engine
> that now works.  
> 
> I'm now using the SetTradeDelays function so that the backtester will
> trade the following day.   I have the revised code below thinking that
> this will backtest using today's signals to either buy or sell
> tomorrow using tomorrow's price targets.   The AmiBroker explorer
> function will report Next Day's Target prices every day.   Is the
> below code legit for this?   Am I missing something or do you have an
> comments? 
> 
> Thank you!
> 
> Three
> 
> 
> 
> 
> // Simple ATR Script by Andrew Senft
> //
> 
> // One position at a time
> SetOption("MaxOpenPositions", 1 );
> 
> // Trade tomorrow
> SetTradeDelays(1,1,0,0);
> 
> // Make sure that tomorrow's price is tradable
> SetOption("PriceBoundChecking", True);
> 
> // Optimization
> BuyOffSet =  2; //Optimize("BuyOffSet",2,1,20,1);
> BuyATRPeriod = 1; //Optimize("BuyATRPeriod",1,1,5,1);
> ATRMultiplier = 1; //Optimize("ATRMultiplier",1,0.7,1.20,.1);
> 
> // ATR funciton
> Graph8 = HHV(High - ATRMultiplier * ATR(BuyATRPeriod), BuyOffset);
> 
> // Finding a Buy or Sell signal
> Buy = Cross(Close,Graph8);
> Sell = Cross(Graph8,Close);
> 
> // Either Buy or Sell it
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
> 
> // Tomorrow's target prices
> BuyPrice = Ref(Graph8,-1);
> SellPrice = Ref(Graph8,-1);
> 
> // Explore reporting every trading day
> Filter=(1);
> AddColumn( IIf(Buy==1,1,IIf(Sell==1,-1,0) ), "Long/Sell", 1.0);
> AddColumn( BuyPrice, "Tomorrow's Target Price");
> AddColumn( Graph8, "Today's Target Price" );
> AddColumn( ATR(BuyATRPeriod), "ATR    " );
> AddColumn( O, "Open        ");
> AddColumn( H, "High        ");
> AddColumn( L, "Low         ");
> AddColumn( C, "Close       ");
>



------------------------------------

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

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

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

For other support material please check also:
http://www.amibroker.com/support.html

*********************************
Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/