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

*****SPAM***** RE: [amibroker] Back-testing a simple trading system



PureBytes Links

Trading Reference Links

SPAM: -------------------- Start SpamAssassin results ----------------------
SPAM: This mail is probably spam.  The original message has been altered
SPAM: so you can recognise or block similar unwanted mail in future.
SPAM: See http://spamassassin.org/tag/ for more details.
SPAM: 
SPAM: Content analysis details:   (5.30 hits, 5 required)
SPAM: IN_REP_TO          (-0.8 points) Found a In-Reply-To header
SPAM: FROM_ENDS_IN_NUMS  (0.9 points)  From: ends in numbers
SPAM: COMMENT            (0.8 points)  Found a Comment header
SPAM: TO_BE_REMOVED_REPLY (0.4 points)  BODY: Says: "to be removed, reply via email" or similar
SPAM: SPAM_PHRASE_03_05  (1.1 points)  BODY: Spam phrases score is 03 to 05 (medium)
SPAM:                    [score: 4]
SPAM: DATE_IN_PAST_96_XX (1.5 points)  Date: is 96 hours or more before Received: date
SPAM: FORGED_YAHOO_RCVD  (1.4 points)  'From' yahoo.com does not match 'Received' headers
SPAM: 
SPAM: -------------------- End of SpamAssassin results ---------------------


all the bosses sorry for disturbing you.I am not a
programmer so i cant debug the errors.
will you help me by sending the full coding?it is
giving error.
Thanks to all.


Rukon

--- Amit Ehrenreich <amite@xxxxxxxxxxxxxxxxxx> wrote:

> Frank,
>  
> Say you want to sell after a 3% rise, and have a
> stop-loss after a 2% drop. The following code should
> point you in the right direction. 
>  
> for (i = 1; i <= Barcount-1; i++) {
>        if (Buy[i]) {
>             // 3 Percent profit, 2 Percen loss
>             wPct = 3;
>             lPct = 2;
>             for (j = i; j <= Barcount-1; j++)  {
>                     if (Low[j] <= (1 -
> lPct/100)*BuyPrice[i]) { 
>                           Sell[j] = 1;
>                           SellPrice[j] =
> Min(Open[j], (1-lPct/100)*BuyPrice[i]);
>                           i = j;
>                           j = Barcount; // Terminate
> loop
>                     }
>                     if (High[j] >= (1 +
> wPct/100)*BuyPrice[i]) {
>                           Sell[j] = 1;
>                           SellPrice[j] =
> Max(Open[j], (1+wPct/100)*BuyPrice[i]);
>                           i = j;
>                           j = Barcount; // Terminate
> loop
>                     }
>              }
>        }
> }
>  
>  
> Regards,
>  
> Amit Ehrenreich
> Market Testing Wizards
> www.markettestingwizards.com
>  
> 
> ________________________________
> 
> From: amibroker@xxxxxxxxxxxxxxx on behalf of
> cstdc5588
> Sent: Wed 3/26/2008 7:01 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Back-testing a simple trading
> system
> 
> 
> 
> I want to back-testing a simple trading system, the
> formula is as 
> follows: 
> 
> Cond = Cross( MA (Close, 20), MA(Close, 50) );
> Cond1 = Cross( MA (Close, 50), MA(Close, 20) );
> MA20 = MA( Close, 20 );
> MA50 = MA( Close, 50 );
> Crosses = Cross( MA20, MA50 ) OR Cross( MA50, MA20 )
> ;
> Buy = Cond;
> Sell = Cond1;
> 
> I'm going to add buy(or short) and sell(or cover),
> as well as stop-
> loss conditions. Such as: when to buy or short a
> stock, if it has a 
> profit of 3%, should sell(or cover) to close this
> position. If the 
> loss occurred, when the loss is 2% to sell(or cover)
> to stop loss. In 
> addition, total capital is $100,000, per transaction
> for a 10% of the 
> capital, while a maximum of 10 positions, not
> considering 
> commissions. I don't know how to write this formula,
> any help would 
> be appreciated!
> 
> Frank
> 
> 
> 
>  
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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

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/