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

Re: [amibroker] Performance Charts



PureBytes Links

Trading Reference Links

Can you do something with this code (use param to spot the 
difference between the two Buy statements)?



x=Param("choose",0,0,1);
Plot(C,"",colorDefault,styleCandle);
Buysetup=Cross(MACD(),Signal());
triggerlevel=ValueWhen(Buysetup,H);

if(x==0)
{
Buy=Cross(C,triggerlevel);
}
else
{
Buy=Cross(Sum(Cross(C,triggerlevel),BarsSince(Buysetup)),0);
}

Plot(Buysetup,"",colorBlue,styleHistogram|styleOwnScale );
PlotShapes(Buy*shapeUpArrow,colorGreen);

Johan




--- In amibroker@xxxxxxxxxxxxxxx, Rakesh Sahgal <rakeshsahgal@xxxx> 
wrote:
> I have a formula that says:
>  
> 1. Go long when long StochK crosses StochD and vice versa for 
short.
>  
> 2. Trigger to be crossed for executing the trade is close higher 
than the high of the crossover day and once again vice versa for 
short.
>  
> Once a long signal is given both in terms of indicator and price 
crossover, the value of the high of the crossover bar is irrelevant.
>  
> Now the problem:
>  
> However what is happening is:
>  
> 1. Buy Trade arrow is displayed - Correctly .
> 2. Sell Trade arrow is displayed - Correctly.
>  
> this is where the foul up is happening:
>  
> 3. When the price again crosses the level determined in 1 an arrow 
is plotted even though it has no relevance/significance.
>  
> I experimented with EXREM, but to no avail. Can someone kindly 
point out the error in my logic/coding which is causing this wrong 
display of arrows to occur? 
>  
> TIA
>  
>  
> Rakesh
>  
> 
> 		
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! - Internet access at a great low price.



------------------------ 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
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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/