Chaitanya,
This is because AFL processes inTrade as an array. Within the loop, for each bar, inTrade is set to true or false. When you access inTrade by itself outside the loop, you access the value of inTrade for the bar that AFL is processing. Which will be zero (as set on the first line) unless your code has changed it during loop processing, for the current bar. Best, _____ From: [email protected] [mailto:[email protected]] On Behalf Of Chaitanya Sent: 27 October 2009 09:09 To: [email protected] Subject: [amibroker] cant get to set a simple boolean variable.. New problem: I cant seem to get a simple boolean variable working; here is sniplet of code.. intrade = 0; //intrade = false; for(i=1; i < barcount; i++) { if(my condition) { intrade = 1; } etc etc.. } The intrade = 1 in the above program seems to be never executing even though the program is traversing into the loop; and the bool always stays false (0); what am i doing wrong? --- In amibro...@yahoogrou <mailto:amibroker%40yahoogroups.com> ps.com, "Chaitanya" <kci...@...> wrote: > > never mind; got it using appending strings to any existing study on the chart. like.. > > Plot( MA(200), "RSI value " + r + "myBool Value " + boolVar1, colorblue ); > > > > --- In amibro...@yahoogrou <mailto:amibroker%40yahoogroups.com> ps.com, "Chaitanya" <kcityg@> wrote: > > > > i have found it useful to write any indicator values or variable values directly on amibroker UI rather than using a separate debug window (for one it makes tracking bar per bar easier) but i forgot how i did that in the past. > > > > Can someone point me to an example.. > > > > Example: I have a boolean (true/false) variable and an array variable say BuySignal array. i want to print the values of these two variables as i progress from bar to bar on the chart pane itself. > > > > > > thanks! > > -gariki > > >
