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

[amibroker] Re: coding help request- higer values...



PureBytes Links

Trading Reference Links

Your logic is flawed. Cond3 can never be true.

Note that Cross returns 1 or 0. So, there are 3 possible scenarios for any two sequential Cond1 values x,y where x is the previous bar value and y is the current bar value:

0, 0 zero followed by a zero (no recent cross)
0, 1 zero followed by a one (cross = true on current bar)
1, 0 one followed by a zero (cross = true on previous bar)
1, 1 (not possible since cross cannot happen twice in a row)

Now look at your Ref statement, Ref(Cond1, Cond1 - 1), for each scenario:

0, 0 -> Ref(Cond1, 0 - 1) gives previous bar value of 0
0, 1 -> Ref(Cond1, 1 - 1) gives current bar value of 1
1, 0 -> Ref(Cond1, 0 - 1) gives previous bar value of 1

And your final logic of Cond1 > Ref(Cond1, Cond1 - 1)

0, 0 -> 0 : 0 not greater than 0
0, 1 -> 1 : 1 not greater than 1
1, 0 -> 1 : 0 not greater than 1


Mike

--- In amibroker@xxxxxxxxxxxxxxx, "shahariar4" <shahariar4@xxx> wrote:
>
> Hi, All Memebrs,
> 
> Some little help in needed for the following idea.
> 
> I have tried a code as follows but it does not show any result or arrow...what am i making wrong?
> 
> Buy= when cond1 occurs and this cond1 has to be of higer value than the last cond1
> 
> 
> Cond1=Cross( ZLTyp, ZLHa );
> Cond2=Cross( ZLHa, ZLTyp );
> Cond3= Cond1> Ref(Cond1,Cond1 -1);
> 
> 
> Buy=IsTrue(Cond1 AND Cond3);
> 
> 
> // Suppose i am using a pivotlow as my buy signal, if the pivotlow my scan ditercts during scan, that pivotlow has to be at higer position than the previous pivotlow; so as like finding an uptrend with pivots........
>




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

**** 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/

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/