On 2/4/2016 10:11 AM, psytek@bell.net [amibroker] wrote:
Hello,
Snippets are about the biggest editing time-saver AB has ever introduced. If you have a good assortment of snippets that reflects your programming style you can now implement/test a new system idea in minutes instead of hours.
I thought I would start a thread in which we could share Snippets now and then. Please join in on the effort to promote/share the use of snippets!
Happy Trading,
Herman
_SECTION_BEGIN( "Pricing-Error Checking" );
// While you can turn ON priceboundchecking to keep your tradeprices within the H-L range
// this will hide any pricing errors you may have made. I often append the code below to any new
// system under development to help me spot pricing errors. Please Test/Verify the code before using it!
if( ParamToggle( "PriceboundChecking", "OFF|ON", 0 ) )
{
SetBarsRequired( sbrAll, sbrAll );
SetOption( "PriceBoundChecking", False );
BuyError = ( BuyPrice > H OR BuyPrice < L ) AND Buy;
SellError = ( SellPrice > H OR SellPrice < L ) AND Sell;
ShortError = ( ShortPrice > H OR ShortPrice < L ) AND Short;
CoverError = ( CoverPrice > H OR CoverPrice < L ) AND Cover;
PricingErrors = BuyError OR SellError OR ShortError OR CoverError;
Plot( PricingErrors , "", colorred, styleArea | styleOwnScale, 0, 5 );
Title = "Buy/Sell Pricing Errors: " + NumToStr( PricingErrors , 1.0, False ) +"\n"+
"#Same Day Buy and Sell: "+ NumToStr(Cum( Sell AND Buy),6.0);
}
_SECTION_END();
Posted by: Alan <alan@thenorthams.us>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
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