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

[amibroker] Re: How to explore different strategies?



PureBytes Links

Trading Reference Links

You almost have it. I assume you just want to print this out using 
the Exploration function in Analysis. But you can also plot them on 
the same chart. All you need to do is change the name of the buy and 
sell to make them different.

//////////////Strategy24//////////////////
Buy24a= Buy Cond. Str24;
BuypriceStr24=Buyprice Cond. Str24;
Sell24a= Sell Cond. Str24;
SellPriceStr24=SellPrice Cond. Str24;
Buy24 = ExRem(Buy24a,Sell24a);
Sell24 = ExRem(Sell24a,Buy24a);

//////////////Strategy20//////////////////
Buy20a = Buy Cond. Str20;
BuypriceStr20=Buyprice Cond. Str20;
Sell20a= Sell Cond. Str20;
SellPriceStr20=SellPrice Cond. Str20;
Buy20 = ExRem(Buy20a,Sell20a);
Sell20 = ExRem(Sell20a,Buy20a);

Filter = Buy20 Or Sell20 OR Buy24 OR Sell24;

//////////////Filter for Exploration Str24///////////////
AddColumn( Buy24, "Buy 24", 1 );
AddColumn( Sell24, "Sell 24", 1 );
AddColumn(IIf(Buy Cond. Str24,BuypriceStr24,0), "BuypriceStr24");
AddColumn(IIf(Sell Cond. Str24,SellPriceStr24,0),"SellPriceStr24");
//////////////Filter for Exploration Str20///////////////
Filter=Buy Or Sell;
AddColumn( Buy20, "Buy 20", 1 );
AddColumn( Sell20, "Sell 20", 1 );
AddColumn(IIf(Buy Cond. Str20,BuypriceStr20,0), "BuypriceStr20");
AddColumn(IIf(Sell Cond. Str20,SellPriceStr20,0),"SellPriceStr20");

// to plot them on a chart so you can watch both real time
// the 20 strategy will print above the line and the 24 below. The 
// sell signals are shorter just in case they appear on the same bar
plot(buy20, "Buy 20", colorred);
plot(sell20 * 0.75, "Sell 20", colorred, styledashed);
plot(-buy24, "Buy 24", colorgreen);
plot(-sell24 * 0.75, "Sell 24", colorgreen, styledashed);

--- In amibroker@xxxxxxxxxxxxxxx, "zozuzoza" <zozuka@xxx> wrote:
>
> Hi,
> 
> I have developed 2 different strategies and cannot figure out how I
> could explore both at the same time. The 2 strategies use EOD data 
of
> thousands of stocks so they are not intraday strategies. However , 
the
> last bar is updated during market hours, i.e. the closing price of 
the
> last bar is continiosly updated until the market is closed. The 2
> trading systems give different buy and sell signals and I would like
> to trade them together. I want the exploration to give me buy and 
sell
> alerts for both systems.
>  
> The exploration looks like as follows. I get signals for the last
> strategy20 and cannot get signals for strategy 24.
> 
> Does anybody have an idea how to combine different strategies to 
give
> buy and sell alerts in the exploration?
> 
> Thanks a lot for your help.
> 
> //////////////Strategy24//////////////////
> Buy= Buy Cond. Str24;
> BuypriceStr24=Buyprice Cond. Str24;
> Sell= Sell Cond. Str24;
> SellPriceStr24=SellPrice Cond. Str24;
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
> //////////////Filter for Exploration Str24///////////////         
> Filter=Buy Or Sell;
> AddColumn( Buy, "Buy", 1 );
> AddColumn( Sell, "Sell", 1 );
> AddColumn(IIf(Buy Cond. Str24,BuypriceStr24,0), "BuypriceStr24");
> AddColumn(IIf(Sell Cond. Str24,SellPriceStr24,0),"SellPriceStr24");
> 
> //////////////Strategy20//////////////////
> Buy= Buy Cond. Str20;
> BuypriceStr20=Buyprice Cond. Str20;
> Sell= Sell Cond. Str20;
> SellPriceStr20=SellPrice Cond. Str20;
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
> //////////////Filter for Exploration Str20///////////////         
> Filter=Buy Or Sell;
> AddColumn( Buy, "Buy", 1 );
> AddColumn( Sell, "Sell", 1 );
> AddColumn(IIf(Buy Cond. Str20,BuypriceStr20,0), "BuypriceStr20");
> AddColumn(IIf(Sell Cond. Str20,SellPriceStr20,0),"SellPriceStr20");
>




Please note that this group is for discussion between users only.

To get 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/