
Forums (http://www.elitetrader.com/vb/index.php)
- Strategy (System) Design (http://www.elitetrader.com/vb/forumdisplay.php?forumid=34)
-- Easylangage Candle Data (http://www.elitetrader.com/vb/showthread.php?threadid=247211)
Easylangage Candle Data
Hi,
I'm hoping that someone would be able to help. I'm trying to get/store the open/close/low/high of a candle that had a trade triggered of it.
The trades will be triggered of a simple wma cross over but i would like to store that candle data for future use, ie Tp Sl ect.
Was thinking of something like a tick counter that would increment for every bar after entry bar and then use that to get the value of it. Not sure how to code this.
Thank you,
Roughly (I can't test):
code:
Inputs: Window(20); Variables: WMAFast(0), WMASlow(0), CollumnNum(0), RowNum(0); Array: BarData[99,3](0,0); //you can use 1 array or 4 arrays (This is an array with 100 collumns and 4 rows) WMAFast = average ( c , window); WMASlow = average ( WMAFast , window); If WMAFast crosses above WMASlow then begin //your long entry rules o = BarData[CollumnNum, RowNum]; h = BarData[CollumnNum, RowNum+1]; l = BarData[CollumnNum, RowNum+2]; c = BarData[CollumnNum, RowNum+3]; CollumnNum = CollumnNum + 1; End;
Thank you for help, but the issue isn't the execution of the ma. I've write the code for that. The issue more so getting high/low date from the candle of which the trade was executed however may bars back.
I've tried to use this but from memory i think the issue was that it would read the open/close as the high/low not the actual wicks.
[code]
if (count1 = 0 ) then begin
if (barssinceentry > 0) then begin
count1 = count1 +1;
if (barssinceentry > count1) then begin
count1 = count1 + 1;
end;
end;
end;
Quote from SlowCarry:
Thank you for help, but the issue isn't the execution of the ma. I've write the code for that. The issue more so getting high/low date from the candle of which the trade was executed however may bars back.
I've tried to use this but from memory i think the issue was that it would read the open/close as the high/low not the actual wicks.
code:
if (count1 = 0 ) then begin if (barssinceentry > 0) then begin count1 = count1 +1; if (barssinceentry > count1) then begin count1 = count1 + 1; end; end; end;
code:
h[barssinceentry] //returns the high of the bar 'barssinceentry' bars ago
code:
D[10] //returns the date of the bar ten bars ago
All times are GMT. The time now is 03:15 AM.