Comment on Code your Technical Analysis strategy

Nithin Kamath commented on 30 Apr 2013, 03:28 PM


Presently you cannot code yesterday’s close or today’s open.

But if you are doing it on a particular time frame and use the start/stop time as explained in this blog you can manage. You can keep start as 10.15am and end as 3.10pm. No new alerts come after 3.10pm, but if there is a position/order, it will continue to exist unless you cancel manually.

If you are writing this on a candle basis

Buy expression: Close>REF(Close,1) AND Close>Open

Buy exit: 0

Sell expression: Close<REF(Close,1) AND Close<Open

Sell exit: 0

You can also have a preset stop loss % as explained in the blog.

Hopefully this helps.

View the full comment thread »