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

[amibroker] Re: Yet another beginner!



PureBytes Links

Trading Reference Links

Hello Jon,

> But how do you write the following?
> If the average close of the last 4 days  > the average close of the
> (2nd,3rd,4th and 5th last days) and yesterdays range < the average 
of
> the 2nd,3rd,4th and 5th last day ranges divided by 2, then buy 
todays
> open.      

Try this (I assumed that you ment AverageTrueRange) - you can 
substitute any Range calculation for the ATR's if you want e.g. Range 
= High - Low;

***************************************************************

Condition1 = Ref(MA(C,4),-1) > Ref(MA(C,4),-2);
Condition2 = Ref(ATR(1),-1) < Ref(MA(ATR(1),4),-2)/2;

Buy = Condition1 AND Condition2;

BuyPrice = Open;

******************************************************************

brian_z

--- In amibroker@xxxxxxxxxxxxxxx, "Jonathan Morse" <jonowm@xxx> wrote:
>
> Hi all
> Hoping someone can help out a beginner with some fairly simple code.
> If I can get some basics under my belt, should be able to go from 
there. 
> I understand how to start writing the coding i.e 
> SetTradeDelays( 0, 0, 0, 0 );
> SetOption( "FuturesMode", True);
> SetOption("InitialEquity", 10000 );
> SetOption("CommissionMode",3);
> SetOption("CommissionAmount",15);
> RoundLotSize = 1; //
> MarginDeposit = 2500;// The margin is the amount of money required 
to
> open single contract position.
> TickSize = 1;
> PointValue = 7.5; // $7.5 profit/loss per point
> PositionSize = MarginDeposit; //trade 1 contract
> 
> But how do you write the following?
> If the average close of the last 4 days  > the average close of the
> (2nd,3rd,4th and 5th last days) and yesterdays range < the average 
of
> the 2nd,3rd,4th and 5th last day ranges divided by 2, then buy 
todays
> open.      
> 
> Many thanks in advance
> jon
>




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/