Requests & Ideas - page 24

biddick
339
biddick  

Thank you very much Mladen.

brax64
158
brax64  

Hi all,

I need an help with this 2 indicator; they suppose to generate tick chart on MT4

You have to put the "LogTickData" indicator in a 1M chart, then on the same window attach the "PostTickData" with parameter the number of ticks that you want.

After that you should have your tick chart in the offline menu.

My problem is that the tick chart didn't update itself, I've to refresh the chart if I want read the last data (under alpari MT4) or (under forex.com MT4) when I try to open the tick chart I got only "waiting for update" and that's it.

Any help about that?

Thanks in advance for your reply

Best Regards

Brax64

Files:
biddick
339
biddick  
mladen:
Zipfrog

Here you go

Alert are triggered when a high penetrates +8 or when a low penetrates -8 level.

regards

Mladen

Mladen

Addition to this can you add arrows when the high penetrates +8 or when the low penetrates -8 level.Thanks

Mladen Rakic
155733
Mladen Rakic  

Brax64

Try this out

I tested it but not extensively (made it today so did not have time enough to test it extensively) The ones you posted are too heavy on CPU and way to complicated for my taste so decided to make a completely new (as simple as possible one) indicator. At a first glance it works OK, but please, if you notice any problems, let me know

_______________________________

Way to use :
Actually almost nothing to tell here. There are no parameters and there are no required time frames that you have to attach it to. It is an indicator (so place it in indicators folder) and it will work the same regardless of the time frame it is attached to. You can change time frames at the chart it is attached to freely (it will not stop, all you risk is loosing a tick or two and adding one extra tick at a same price as the last tick) as long as you do not change the symbol

It will create a file that is starting with "_t" and adds symbol name after it. It "pretends" to be 1 minute chart, but it is not (of course ) Just open that symbol as offline chart and use it (the indicator must be active on some other chart in order to get "live" ticks) Also, set the display type to line chart since otherwise you are going to get only dots on screen (all the prices are the same, so bars or candles are meaningless in this mode)

Tried to use indicators on it and every one that does not have hard coded symbol name or time frame works OK (here is an example of such a chart - just threw some of the indicators from my list in indicators list)
_______________________________ Known issues :
None that I know of at a moment
_______________________________ A will do:
The way it works now you do not see that it works when you place it at a chart. Will do some fast (so that eventual ticks do not suffer) way that will "tell" that it is working
_______________________________

PS: forgot to tell - it has to have (the indicator) "Allow DLL imports" in options in order to work

PPS: due to metatrader limitation that handle to a first occurrence of a window with a specific symbol used is returned if you have more than 1 offline chart with a same symbol opened only the first window will be updated automatically (live) In the rest you will have to switch between charts (metatrader refreshes the chart automatically when it receives focus) But as I say, it is only when you have more than 1 offline chart with the same symbol tick data loaded

_______________________________

regards

Mladen

brax64:
Hi all,

I need an help with this 2 indicator; they suppose to generate tick chart on MT4

You have to put the "LogTickData" indicator in a 1M chart, then on the same window attach the "PostTickData" with parameter the number of ticks that you want.

After that you should have your tick chart in the offline menu.

My problem is that the tick chart didn't update itself, I've to refresh the chart if I want read the last data (under alpari MT4) or (under forex.com MT4) when I try to open the tick chart I got only "waiting for update" and that's it.

Any help about that?

Thanks in advance for your reply

Best Regards

Brax64
Files:
Mladen Rakic
155733
Mladen Rakic  

This should cover all the issues with saving I could think of till now regarding tick data

_______________________

Two options added :
ResetData-
Added it in order to be able to "start from the beginning" (if you turned off your PC and a "time gap" occurs since there is no way to reconstruct tick data or any other reason when you do not want the data to be appended to already existing tick data) If you set this parameter to true, it will start a new tick data history.

Be careful with this option since it will do the same thing whenever you change time frames or restart metatrader too, so usually it should be used just once : set it to true, wait for 1 tick to have the file reset and then set it to false and off you go

ShowComment-
It is the fastest way to show that it is working, so if you set it to true it will simply comment in the upper left corner that tick data is saved and a time when it was saved. That way it will not be engaged in complicated object(s) creation - updates and will not miss any ticks
Some minor code changes done too but they affect only the eventual speed of execution (a tiny bit faster now)

_______________________

Note : the nature of ticks is that a tick can not be identified by the time it happened (it is a random time). Hence, you can not have more than one indicator for the same symbol active : it will end up writing same ticks as many times as much instances of the indicator are loaded. So keep just one instance of the indicator per symbol active

PS: changed the tick price from Close to Bid. It solves a problem of very different prices that sometimes happen when time frames are changed

Mladen Rakic
155733
Mladen Rakic  

This is contagious

_________________________

Some more additions and changes :
Added an option to choose how many ticks do you want per bar. Indicator is differentiating 2 basic types. When required number of ticks per bar is 1, it records bid as low and ask as high, so you can have a sort of a "spread control" (since now you can see those ticks as lines but you can see them as bars too, as in this example )

When required number of ticks is greater than 1 then you are getting a sort of "equi-volume" charts (every bar is having a same volume when you turn the volume display on) High, low, open and close are constructed from a Bid. As an example here is a 10 ticks chart of EURUSD

Decided to change the name and add version to the indicator since it seems that this is a never ending story type of indicator (always something can be added and always something to be solved differently) Now stopping to post new versions of this one today or I risk to get killed by ND for spamming

Wish a great weekend to all

Mladen Rakic
155733
Mladen Rakic  
I was curious what would happen if I use the "Tick data" indicator in a visual back test mode. Well, refreshing the target window does not work (in a back test mode, of course) but with some code adapting (the additional TestModeparameter is used for that purpose - by all means use it in back test mode since it will not work otherwise) I was able to produce an offline chart of ticks simulated by metatrader (the "Every tick (the most precise....)" stuff. And this is what I got :
Test was with a 10 ticks per bar (visible from the volume) but the result is (or maybe better to tell, isn't) surprising : for a 10 tick bars the changes are poor and real data flow simulation is far, far from anything real. If you are testing an EA that depends on a narrow take profits or stops, this example shows you that back test can not be trusted at all

_______________________

PS: the attached indicator is, apart from having the possibility of recording test data, a revised version with some code optimization and some corrections (there was one error that needed attention )

Tistou
53
Tistou  

Hi Mladen

Could you program the two Marney indicators, Fx Trader Magazine spoke in the month of July-September.

Here are the codes I think Ninja Trader

Marney Volume Indicators:

{***********************************************}

{Marney Indicator(TM) - Marney Volume Indicator(TM)

Copyright Caspar Marney, Marney Capital 2010(C)}

{***********************************************}

input: avgLen(10), mins.in.session(1440), autobars(True), upcolor(cyan), dncolor(red);

var: start(0), end1(0), end2(0), x(0), p(-1), count(0), avg(0), barsinday(0), DayNumber(0);

array: xv[199,1440](0);

if bartype < 2 then begin

start= (Sessionstarttime(1,1));

end1= (sessionendtime(1,1));

end2= (sessionendtime(1,2));

value1 = timetominutes(start);

value2 = timetominutes(end2);

if start > end2 then

value3 = 1440+(value2-value1);

if start < end2 then

value3 = -(value1-value2);

if autobars = false then value3 = mins.in.session;

barsinday = ceiling(value3/barinterval);

if dd[1] then begin

if count=barsInDay then begin

p=iff(p<avgLen-1,p+1,0);

for x=1 to barsInDay begin

xv[p,x]=ticks;

end;

end;

count=1;

end else count=count+1;

if xv[avgLen-1,count]>0 then begin

avg=0;

for x=0 to avgLen-1 begin

avg=avg+xv[x,count];

end;

avg=avg/avgLen;

plot2(ticks,"ticks",default,1);

plot1(avg,"avg",yellow,default,1);

end;

if close > open then setplotcolor(2,upcolor);

if close < open then setplotcolor(2,dncolor);

end;

if bartype > 1 then begin

avg = averagefc(v,avglen);

plot2(v,"ticks",default,1);

plot1(avg,"avg",yellow,default,1);

if close > open then setplotcolor(2,upcolor);

if close < open then setplotcolor(2,dncolor);

end;

{***********************************************}

{Marney Indicator(TM) - Marney Volume Indicator(TM)

Copyright Caspar Marney, Marney Capital 2010(C)}

{***********************************************}

Marney Range Indicator:

{***********************************************}

{Marney Indicator(TM) - Marney Range Indicator(TM)

Copyright Caspar Marney, Marney Capital 2010(C)}

{***********************************************}

input: avgLen(10), mins.in.session(1440), autobars(True), upcolor(cyan), dncolor(red);

var: start(0), end1(0), end2(0), x(0), p(-1), count(0), avg(0), barsinday(0);

array: xr[50,1440](0);

if bartype < 2 then begin

start= (Sessionstarttime(1,1));

end1= (sessionendtime(1,1));

end2= (sessionendtime(1,2));

value1 = timetominutes(start);

value2 = timetominutes(end2);

if start > end2 then

value3 = 1440+(value2-value1);

if start < end2 then

value3 = -(value1-value2);

if autobars = false then value3 = mins.in.session;

barsinday = ceiling(value3/barinterval);

if dd[1] then begin

if count=barsInDay then begin

p=iff(p<avgLen-1,p+1,0);

for x=1 to barsInDay begin

xr[p,x]=truerange;

end;

end;

count=1;

end else count=count+1;

if xr[avgLen-1,count]>0 then begin

avg=0;

for x=0 to avgLen-1 begin

avg=avg+xr[x,count];

end;

avg=avg/avgLen;

plot2(truerange,"range",default,1);

plot1(avg,"avg",yellow, default,1);

end;

if close > open then setplotcolor(2,upcolor);

if close < open then setplotcolor(2,dncolor);

end;

if bartype > 1 then begin

avg = averagefc(truerange,avglen);

plot2(truerange,"range",default,1);

plot1(avg,"avg",yellow, default,1);

if close > open then setplotcolor(2,upcolor);

if close < open then setplotcolor(2,dncolor);

end;

{***********************************************}

{Marney Indicator(TM) - Marney Range Indicator(TM)

Copyright Caspar Marney, Marney Capital 2010(C)}

{***********************************************}

Here is a description of these indicators ( page 28-31 )

Best regards and good Week-end

Gafet

Files:
brax64
158
brax64  
mladen:
I was curious what would happen if I use the "Tick data" indicator in a visual back test mode. Well, refreshing the target window does not work (in a back test mode, of course) but with some code adapting (the additional TestModeparameter is used for that purpose - by all means use it in back test mode since it will not work otherwise) I was able to produce an offline chart of ticks simulated by metatrader (the "Every tick (the most precise....)" stuff. And this is what I got :
Test was with a 10 ticks per bar (visible from the volume) but the result is (or maybe better to tell, isn't) surprising : for a 10 tick bars the changes are poor and real data flow simulation is far, far from anything real. If you are testing an EA that depends on a narrow take profits or stops, this example shows you that back test can not be trusted at all

_______________________

PS: the attached indicator is, apart from having the possibility of recording test data, a revised version with some code optimization and some corrections (there was one error that needed attention )

Hi Mladen,

It's difficult to find a way to say "thank you!!!". Your job here is priceless I'm glad to see that there are still persons around dedicated to help others.

A word of gratitude to you Mladen, thanks a lot!

Best regards and enjoy the weekend!!

Brax 64

Mladen Rakic
155733
Mladen Rakic  

Gafet

It is not NinjaTrader script but tradestation Easy language script, but does not matter

First of all, thanks for the pdf and implicitly the link to FXtradermagazine. Downloading the rest of the issues now and it seems that it is not so bad a magazine.

_________________________

The first indicator made from your post is the Marney volume indicator. There is one deviation from Marneys original (code is completely different, but that is a consequence of different platforms. The calculation is the same (we are much faster if I may add ) : in his code, in cases when a bar is missing from any reason it is used in the average as 0 (it is due to the way he treats arrays) and in mine the missing bars are simply skipped and previous bar that conforms to time search is used. That way the original idea of Caspar Marney is honored to the letter and the average is always an average of AveragePeriods.

Cases when the missing bar will happen are very rare and it can be neglected, but, nevertheless, I wanted to have the exact number of volumes added every time

Also, for periods greater than or equal the average is a simple average of volumes (no time adjustment, just one bar back average - it is the same in the original) so there is no visible periodicity in those time frames

_________________________

To conclude - here are 2 examples : 30 minute and 1 hour, and even with a short averaging period (10 in the examples) periodicity is obvious. Just remember that current bar is never going to change (it is actually a "forecast" from past volumes - so it does not change at all while new data is coming in)

regards

Mladen