PureBytes Links
Trading Reference Links
|
If your conditions can be enumerated in a systematic way, you could
write a code generator to emit the code automatically. This would work
well if you wanted condition arrays for every possible combination of
several subconditions. If you had 8 subconditions, it would be fairly
easy to emit the afl for the 256 combinations of those subconditions.
-Steve
--- In amibroker@xxxxxxxxxxxxxxx, "sidhartha70" <sidhartha70@xxx> wrote:
>
> A little bit of code advice if I can... I have a very large number of
> conditional statements that I am intending to use to draw indicators
> on various bars...
> The conditional statements can be quite complex, but they are all of a
> similar form to the following which I include as an example,
>
> Condition1=H>Ref(H,-1) AND L>=Ref(L,-1) AND (H-L)>Ref((H-L),-1) AND
> C==O AND C>Ref(C,1) AND H>=Ref(H,1) AND V<Ref(V,-1) AND V<Ref(V,-2);
> Condition2=...
> .
> .
> .
> .
> Condition200=
>
>
> So I am talking a lot of conditional statements.
>
> I then want to both use PlotShapes() to signify when a condition is
> true on the chart and Printf() to print the exact form of true
> condition to the interpretation window... e.g.
>
> if(SelectedValue(Condition1)) printf("COND1\n");
> if(SelectedValue(Condition2)) printf("COND2\n");
> .
> .
> .
> .
> if(SelectedValue(Condition200)) printf("COND200\n");
>
> PlotShapes(Condition1 * shapeSmallDownTriangle,colorGold,0,H);
> PlotShapes(Condition2 * shapeSmallUpTriangle,colorGold,0,L);
> .
> .
> .
> PlotShapes(Condition200 * shapeSmallUpTriangle,colorGold,0,L);
>
> etc...etc...
>
> Obviously this requires many many lines of code... I've been thinking
> there has to be a more efficient way of coding something like this.
> Any thoughts you can throw my way...?
>
> Many Thanks
>
------------------------------------
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL 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/
|