Hello, Single properly written 'for' loop is all you need.
But you need to formulate the problem in plain English with all details, come up with an algorithm and only after is setup up do the coding or hire the programmer to do that for you. Without clear vision of the algorithm written in plain English you should not start coding at all. People without coding experience approach coding from wrong end. They jus start from typing the code. That is wrong. You need an algorithm formulated in english describing the entire problem. Only once entire problem is described in plain english you can start coding. Not the vice versa. Starting with code pieces without having clear vision and underlying abstract algorithm and trying to randomly glue bits found on forum them leads to problems you are having. Best regards, Tomasz Janeczko amibroker.com ----- Original Message ----- From: "Noah Bender" <[email protected]> To: <[email protected]> Sent: Wednesday, June 10, 2009 5:10 PM Subject: [amibroker] Redundant 1s in the buy/sell/short arrays After spending weeks on trying to solve this problem I have come up with the following answer. I want to know if you all agree agree. I want my chart to display the buy,sell,short,cover arrows when 1 occurs in the corresponding array. That I can accomplish. But I have short arrows occuring while I am in the middle of a long trade and long arrows occuring in the middle of a short trade. I have tried a whole bunch of solutions to this problem but at the end of the day to no avail. I saw that zeek/mike had and excahnge about this and so did barry. I have tried a) the exrem function- but that does not solve much even if i do buy=exrem(buy,short or sell); as u suggested in an earlier email .because then a buy can still occur once a short has occured or even i change to cover a buy can still occur if there are 2 short trades in a row. b) i tried setting static vars - but can't backtest them or see them in exploration. so that does me know good. c) I tried using the backtester interface to plot only real trades. that does plot real trades and there are no conflicting signals plotted. but in real time I still get a 1 in the short array while in the middle of a long trade. d) i even tried the flip funciton. but it will always be reset to zero when the code reproccesses the array bc it needs to be initialized. Is there anyway to avoid getting a 1 in the short array while the last signal in the buy/sell array was one in the buy array ( meaning in the middle of a long trade). I am starting to think there is not. PLease correct me if I am wrong. I have seen posts on the forum with similar frustrations. thanks ------------------------------------ **** 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
