Coding help - page 93

 
pgtips:
I did try

yesterday_open = (iOpen("NULL",PERIOD_D1,-1));

yesterday_close = (iClose("NULL",PERIOD_D1,-1));

if ((yesterday_close > yesterday_open))

{

BoxHLColor = Green;

}

else

{

BoxHLColor = Red;

}

but I think I am getting a 0 value each time, so maybe I need an array but unsure how. The above does return a colour change but they are all the same

pgtips

Use 1 instead of -1 and use NULL instead of "NULL". Like this :

yesterday_open = (iOpen(NULL,PERIOD_D1,1));

yesterday_close = (iClose(NULL,PERIOD_D1,1));

if ((yesterday_close > yesterday_open))

{

BoxHLColor = Green;

}

else

{

BoxHLColor = Red;

}

when you use -1 for bar index it means first future bar. 1 means first past bar

 

Thank you, it works (of course!)

I was looking at -1 as being going back candles, so -1 day. Thank you.

Could you tell me how difficult it will be to make this create history, so past boxes are set for each prev day colour so each day set in stone so it does not change colour but gives me history.

Is this advanced. If it is I have another approach I will try first.

thank you again for showing me.

 
pgtips:
I did try

yesterday_open = (iOpen("NULL",PERIOD_D1,-1));

yesterday_close = (iClose("NULL",PERIOD_D1,-1));

if ((yesterday_close > yesterday_open))

{

BoxHLColor = Green;

}

else

{

BoxHLColor = Red;

}

but I think I am getting a 0 value each time, so maybe I need an array but unsure how. The above does return a colour change but they are all the same

Maybe you should try your idea first since it is not so simple to explain

 
mladen:
You have 2 start routines in that code, for start so it is absolutely not clear what is to be done. Also, from the patched TS code it is not visible what is the purpose and what should the indicator do, so, all I can do is look at that text and say that I can not help you since I have no idea what should that do

Hi Mladen

How they can modify their own content made ​​the post , I want to delete the above code!

Thank you

Kreangast

2013/5/29

 
Kreangast:
Hi Mladen

How they can modify their own content made ​​the post , I want to delete the above code!

Thank you

Kreangast

2013/5/29

Kreangast

You can not delete a post. Posts are deleted only and only if they are breaking some of the forum rules, and since your post is not breaking any of the rules, it should not be deleted

 
mladen:
Kreangast You can not delete a post. Posts are deleted only and only if they are breaking some of the forum rules, and since your post is not breaking any of the rules, it should not be deleted

Hi Mladen

I need to edit my post can do

Thank you

Kreangast

2013/5/29

 
Kreangast:
Hi Mladen

I need to edit my post can do

Thank you

Kreangast

2013/5/29

Kreangast

If you need something changed, simply post a new post with changes in it

 
mladen:
Kreangast If you need something changed, simply post a new post with changes in it

I want to change the original post in the ministry under his abridged code can do

Kreangast

 
mladen:
Maybe you should try your idea first since it is not so simple to explain

Hi Mladen,

yes, I can see why it might be hard to explain, it is also very hard to do, my idea was to take a histogram type indicator (I have seen you make several of) and maybe try to apply this as the daily colour but it does not work out so well.

The inputs seem quite straight forward, red or green but it only ever applies this to the current box and all history becomes the same colour. I need to lock it in but I do not know how this is achieved. Would this need an array ?

many thanks again,

PG

 
mladen:
pgtips

Use 1 instead of -1 and use NULL instead of "NULL". Like this :

yesterday_open = (iOpen(NULL,PERIOD_D1,1));

yesterday_close = (iClose(NULL,PERIOD_D1,1));

if ((yesterday_close > yesterday_open))

{

BoxHLColor = Green;

}

else

{

BoxHLColor = Red;

}

when you use -1 for bar index it means first future bar. 1 means first past bar

I'm truly stuck on how to make this work on previous days, current day is always ok but all previous boxes also change to same colour, they do not lock in their colour.

any pointer would be appreciated to help me develop this.

many thanks again,

PG

Reason: