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

[amibroker] HELP with CODE



PureBytes Links

Trading Reference Links

Can someone please help with the code below. The longs and shorts are not 
platting... My mistake might be a very basic one, (I am sure I am messing it 
up with ValueWhen function) but I am unable to fix it.

Thanks.

///////////////////////////////////
Fim = (H-L)/V;

slick = IIf((V > Ref(V,-1) AND (fim < Ref(fim,-1))),2,0);
rake = IIf((V < Ref(V,-1)) AND (fim > Ref(fim,-1)),-2,0);
fall = IIf(fim < Ref(fim,-1) AND V < Ref(V,-1), -1,0);
green = IIf((V > Ref(V,-1) AND (fim > Ref(fim,-1))), 1,0);
Profit = slick + rake + fall + green;

DT = IIf(L<ValueWhen(LLV(L,7),L,2) AND ValueWhen(LLV(L,7),L,2) <
ValueWhen(LLV(L,7),L,3) AND H < ValueWhen(LLV(L,7),H,2) AND
ValueWhen(LLV(L,7),H,2)<ValueWhen(LLV(L,7),H,3),-1,0);

UT = IIf(H>ValueWhen(HHV(H,7),H,2) AND ValueWhen(HHV(H,7),H,2) >
ValueWhen(HHV(H,7),H,3) AND L > ValueWhen(HHV(H,7),L,2) AND
ValueWhen(HHV(H,7),L,2)>ValueWhen(HHV(H,7),L,3),1,0);

//long
lng = IIf(dt == -1 AND profit == 1 OR 2 AND
(ValueWhen(LLV(L,7),profit,2 == 1 OR 2) OR
(ValueWhen(LLV(L,7),profit,3 ==1 OR 2) AND
 H > ValueWhen(HHV(H,7),H,3))),1,0);

//short
sht = IIf(ut == 1 AND profit==1 OR 2 AND
(ValueWhen(HHV(H,7),profit,2 == 1 OR 2) OR
(ValueWhen(HHV(H,7),profit,3 ==1 OR 2) AND
 H > ValueWhen(LLV(L,7),L,3))),-1,0);
//////////////////////////////////////
 


__________ Information from ESET Smart Security, version of virus signature database 4400 (20090906) __________

The message was checked by ESET Smart Security.

http://www.eset.com





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

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