Zerodha Part 2

Status
Not open for further replies.

manojborle

Well-Known Member
Hi Zerodha

I am trying to see the new Algo but when I am clicking on chart I dont see any options to backtest strategy or going live
 

Zerodha

Well-Known Member
Just curiosity; had read the algoZ manual a few months back and did not remember how it handled exceptions, specially runtime ones.

Actually, the question was triggered by your response to Shekhar that Dhiraj's 2652 sytem was "not really technical analysis". Whether it is or not is irrelevant, but one got to wonder why you could not code it. After rereading, I realize that probably algoZ misses the entire class of reflective functions. For example, there is no way to know within the script what is the bar interval, or the time of the latest bar. If this is correct, some of the horses-for-courses kind of systems are ruled out; anything that says first 10 bars of the day, or first 3 days after last expiry, or 2:30 factor.

Reminded of QuoteTracker paintbars.
There is definitely REF functions available, can't really run an algo product without it. http://www.zerodha.com/z-connect/blog/view/code-your-technical-analysis-strategy has a bunch of codes on which REF function has been used.

Now that I am looking at it again, I guess it should be possible. there is just too much written on that blog, if someone can put it all in simple 4 or 5 lines, should have the code..

Cheers..
 

muinali

Well-Known Member
i opened a/c with zerodha ,want to know is there any dealer sitting there ? when i got electricity fail problem then who will place order ?
 

yusi

Well-Known Member
There is definitely REF functions available, can't really run an algo product without it. http://www.zerodha.com/z-connect/blog/view/code-your-technical-analysis-strategy has a bunch of codes on which REF function has been used.

Now that I am looking at it again, I guess it should be possible. there is just too much written on that blog, if someone can put it all in simple 4 or 5 lines, should have the code..

Cheers..
Okay, let's simplify:

1. What function tells you the bar interval? Typical representative response would be 1 minute, or 5 minute, or daily, maybe represented as minute multiples since a time-frame lower than that is unsupported.
2. What function/expression gives the number of bars since market open?

The return value could be a scalar or vector, does not matter.

You are right in that it has to be there somewhere. A bar chart is OHLCV + time representation. The OHLCV have their inbuilt vectors; just where is the time value (and the corresponding time computation functions)?
 
There is definitely REF functions available, can't really run an algo product without it. http://www.zerodha.com/z-connect/blog/view/code-your-technical-analysis-strategy has a bunch of codes on which REF function has been used.

Now that I am looking at it again, I guess it should be possible. there is just too much written on that blog, if someone can put it all in simple 4 or 5 lines, should have the code..

Cheers..




THE MOST IMPORTANT THINGS TO TRACK IN DAY TRADING is Previous days range (difference in days high and days low)

Step 1: Calculate previous days range and compute 3 multiplication factors

PDR = PDH - PDL
F1 = 0.4333 * PDR
F2 = 0.7666 * PDR
F3 = 1.3333 * PDR


Step 2: Get todays range at 9:30 AM and choose one appropriate Factor from the above three multiples.


Current days’ high and low at 9:30 AM ( 15 min after the start of markets)

Opening Range = High – Low (at 9:30 AM)

If F1 > Opening Range
Factor = F1
Else If F2 > Opening Range
Factor = F2
Else If F3 > Opening Range
Factor = F3


Step 3: Generate Signal


Buy stop order for Long = Intraday Low + Factor

Target for Long = Buy Price * 1.005 (0.5 % gain)

Stop for Long = Buy Price * 0.99 (1.0 % Loss)

OR

Sell stop order for Short= Intraday High - Factor

Target for Short = Sell Price * 0.005 (0.5 % gain)

Stop for Long = Sell Price * 1.005 (1.0 % Loss)


***** *****
Zerodha,

Hope it is as short as possible
 

yusi

Well-Known Member
Current days high and low at 9:30 AM ( 15 min after the start of markets)
Shekhar, the problematic computation is the one that is quoted. And, more specifically, which is the candle at 9:30 am or any specific time. Here, for simplicity, we assume that there is enough volume that all candles from the day's open are available and we hard code the time frame.

To draw a bar chart, the data that is retrieved from the server is OHLCV+T. This array is required for graphing. In turn, OHLCV values (and the implicit index of the array as used in REF) are exposed for scripting purposes. Any T related values do not seem to be available.

T (whether it is start datetime of bar, or end time) should obviously be available. Unfortunately, the manual does not say anything. I suspect it has not been exposed to scripting; hope I am wrong.
 
Hi Zerodha,
I think algo is based on chart.First a strategy is prepared from chart, then it is put to algo.So charting should be good first. I face a problem regularly. At some point chart does not move further horizontally, that means no further candle is formed, only vertical up and down move on the same candle. Please solve this problem. Secondly chart window should be detatched from the terminal so that it can minimised to the bar and maximised when required and can be viewed with full screen.
 
Status
Not open for further replies.