Re: [amibroker] Snippet: Detecting Pricing Errors

 

I think this is a good idea.  Question: How do you suggest we add to the thread so the group will know its about a new snippet being added and not just a continuation of the "Detecting Pricing Errors" thread?  Maybe a more generic name for the thread.  Just thinking out loud...  Also would like to see snippets for beginning coders and not just advanced code snippets.

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)
**** IMPORTANT PLEASE READ ****
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/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv