Coding help - page 44

 

...

Can you post the version tha produced that chart (since changing it from separate window to chart does not produce that result at all)?

If not , look for a line in the code you are using that is saying something like this ObjectCreate("whatever",OBJ_LABEL,0, ...) or this ObjectCreate("whatever",OBJ_TEX,0, ...) (probably the OBJ_LABEL version) and that has to be changed in order to avoid that overlapping

________________________________________

PS: if you are using the trick to place it on chart and then change back the "chart" to "separate" (like on the picture from bellow) it will work only if you do the compiling trick, otherwise it can not be done (been testing that stuff with fxbs years ago and it can not be done normally from code) Even then, I do not have that name on my chart (as you can see) so ...

secretcode:
Hello Masters

I wanted to put this indie on main chart but problem is it's name mix with EURUSD O H L C (Attached image) !

What should i do to change in code to hide indie name on main chart so it looks like chart window indicator !

I am not coder so any help would be appreciated.

Thanks in advance

secretcode
Files:
 
mladen:

________________________________________

PS: if you are using the trick to place it on chart and then change back the "chart" to "separate" (like on the picture from bellow) it will work only if you do the compiling trick, otherwise it can not be done (been testing that stuff with fxbs years ago and it can not be done normally from code) Even then, I do not have that name on my chart (as you can see) so ...

Thanks Mladen for help and all your time and efforts

Since i haven't any coding ability i often use that tricky method and save it as Template

Only problem i am facing is mentioned my earlier post that it's mix with Fx Pair O H L C (when you switch TimeFrame, you will find it !)

Here is Template

Files:
pro_go.tpl  1 kb
 

...

Using it through template is tricky Replace init() in the pro go indicator with this one :

int init()

{

IndicatorBuffers(4);

SetIndexBuffer(0,ProGo); SetIndexLabel(0,NULL);

SetIndexBuffer(1,ProGoNoprof); SetIndexLabel(1,NULL);

SetIndexBuffer(2,open_close);

SetIndexBuffer(3,close_open);

IndicatorShortName("");

return(0);

}

And use the attached template. Then you are going to get something like the chart bellow

secretcode:
Thanks Mladen for help and all your time and efforts

Since i haven't any coding ability i often use that tricky method and save it as Template Only problem i am facing is mentioned my earlier post that it's mix with Fx Pair O H L C (when you switch TimeFrame, you will find it !)

Here is Template
Files:
pro_go_1.tpl  1 kb
pro_go.gif  42 kb
 

...

You are retreiving low and high from a current time frame instead from the H4 tme frame. Replace this :

TrendDonchian_Low = Low;

TrendDonchian_High = High;

[/PHP]

with this

[PHP]TrendDonchian_Low = iLow(NULL,PERIOD_H4,iLowest(NULL, PERIOD_H4, MODE_LOW, 120, TrendChartShift + 1));

TrendDonchian_High = iHigh(NULL,PERIOD_H4,iHighest(NULL, PERIOD_H4, MODE_HIGH, 120, TrendChartShift + 1));

and it should work OK

crsnape@btinternet.com:
Hello all,

I've come across a problem with my code.

What I want to do is determine the longer term trend on the H4 chart to filter out short/ long positions on shorter timeframes. I do this by using a donchian channel rather than MA's; price in an uptrend until it breaks the lower band. price in a downtrend until it breaks the upper band.

Anyway I do this by using the following:

//--- Determine trend direction on H4 chart

TrendDonchian_Low = Low;

TrendDonchian_High = High;

static bool TrendChart_UpTrend = false;

static bool TrendChart_DownTrend = false;

if (Ask > TrendDonchian_High) {TrendChart_UpTrend = true; TrendChart_DownTrend = false;}

if (Bid < TrendDonchian_Low) {TrendChart_UpTrend = false; TrendChart_DownTrend = true;}

Then when testing for a position I use..

//--- Check for long entry possibility

if (OrdersTotal() < 1)

{

if (TrendChart_UpTrend == true && TrendChart_DownTrend == false &&...

But its not working. Any ideas?
 
mladen:
Using it through template is tricky

Replace init() in the pro go indicator with this one :

int init()

{

IndicatorBuffers(4);

SetIndexBuffer(0,ProGo); SetIndexLabel(0,NULL);

SetIndexBuffer(1,ProGoNoprof); SetIndexLabel(1,NULL);

SetIndexBuffer(2,open_close);

SetIndexBuffer(3,close_open);

IndicatorShortName("");

return(0);

}

And use the attached template. Then you are going to get something like the chart bellow

Thanks Mladen for coding help

Best Regards

secretcode

 
mladen:
You are retreiving low and high from a current time frame instead from the H4 tme frame. Replace this :
TrendDonchian_Low = Low;

TrendDonchian_High = High;

[/PHP]

with this

[PHP]TrendDonchian_Low = iLow(NULL,PERIOD_H4,iLowest(NULL, PERIOD_H4, MODE_LOW, 120, TrendChartShift + 1));

TrendDonchian_High = iHigh(NULL,PERIOD_H4,iHighest(NULL, PERIOD_H4, MODE_HIGH, 120, TrendChartShift + 1));

and it should work OK

Thanks Mladen for the above ^^^. I amended my own to use iCustom of a donchian channel indicator which too works as I can specify the timeframe. But just wondering which of the two would be best practice/ one to use?

I've been trying to work out how I can enter a trade based on a breakout close above the high/low rather than simply entering a trade as soon as Ask exceeds high. Would like that additional confirmation of candle close. I have tried replacing this under OrderSend:

...Ask > TimingResistance

Where TimingResistance is:

TimingResistance = iCustom(NULL, TimingChart, "Donchian", TimingDNCPeriod, 0, TimingChartShift + 1);

With this:

...iClose (NULL, TimingChart, TimingChartShift + 1) > TimingResistance

But it doesnt like it. Any ideas?

 

...

Frankly I prefer using indicators for multiple reasons :

It keeps the EA cleaner (the cleaner the code the smaller the chance that there will be an error, and there will be errors while developing anything. Whoever thinks differently is dead wrong)

It keeps the indicator easy to improve (without a need to change the EA)

And some things that can be done in an indicator are in some cases impossible if you try with a code embedded in the EA

_______________________________

As of the condition : did you try to use current close instead of previous, so, like this :

iClose (NULL, TimingChart, TimingChartShift) > TimingResistance

without the "+1" in the iClose() shift (just guessing now since I do not know how did you code the indicator).

crsnape@btinternet.com:
Thanks Mladen for the above ^^^. I amended my own to use iCustom of a donchian channel indicator which too works as I can specify the timeframe. But just wondering which of the two would be best practice/ one to use?

I've been trying to work out how I can enter a trade based on a breakout close above the high/low rather than simply entering a trade as soon as Ask exceeds high. Would like that additional confirmation of candle close. I have tried replacing this under OrderSend:

...Ask > TimingResistance

Where TimingResistance is:

TimingResistance = iCustom(NULL, TimingChart, "Donchian", TimingDNCPeriod, 0, TimingChartShift + 1);

With this:

...iClose (NULL, TimingChart, TimingChartShift + 1) > TimingResistance

But it doesnt like it. Any ideas?
 

Coding help

Hello

I need some help in changing one indicator into another way of view.

So I have two pivot indicators. I would like to have AIME Pivots to looks like Pivots Points Update (no lines between days). It will be really great if Someone could help. Thanks in advance

Files:
 

...

Try it out now

Andrewsurfer:
Hello

I need some help in changing one indicator into another way of view.

So I have two pivot indicators. I would like to have AIME Pivots to looks like Pivots Points Update (no lines between days). It will be really great if Someone could help. Thanks in advance
Files:
 
mladen:
Try it out now

Great:) Thank You for Your help. Is there possible to change one more thing? Indicator now is still drawing lines after "Days to plot" period Could You change it so that after days to plot period there won't be any lines?

Reason: