Coding help - page 27

 

reply to #261

Dear mladen

i am new here, cannot pm you, could you message me first via annbeea at yah00 dot com, i can exchange more details, many thanks

 
mladen:
For that I would need to know how you use it for signals (from the code I do not see exactly the "intention" of the indicator. especially since you have a part of code that is using future values for calculations, this part :
for (cnt=ndot1; cnt>=1; cnt--) // n=5 - ? ?? ???

{

ZYVar=ZYVar+(High[shift-cnt+1]+Low[shift-cnt+1])/2*(ndot+1-cnt);

TYVar=TYVar+(High[shift-cnt+1]+Low[shift-cnt+1])/2;

ZIndicatorVar=ZIndicatorVar+iMA(NULL,0,5,3,MODE_SMMA,PRICE_MEDIAN,shift-cnt+1)*(ndot+1-cnt);

TIndicatorVar=TIndicatorVar+iMA(NULL,0,5,3,MODE_SMMA,PRICE_MEDIAN,shift-cnt+1);

}
the shift-cnt+1 expression almost always uses future values (except for the current bar) and will cause te indicator repaint

this seems similar to coeffoline indicator code which (may) repaint.

but this one is a line version show on chart, could you help me to fix this for its repaint issue to non-repaint, the "cannot" display in less than 4 digits instruments issue, add colour to show buy, sell signal and add an audio alert option for colour change? Many thanks for help.

 
mladen:
For that I would need to know how you use it for signals (from the code I do not see exactly the "intention" of the indicator. especially since you have a part of code that is using future values for calculations,

just from my non-coder raw silly guess thinking, i guess using future values may has its merit, because when for example the trend still up, when the most recent data still support "up" direction, then the indicator can still stay the trend without being stop out easily.

 

...

Using future values in calculations is almost the No.1 reason for repainting in any of the "famous" repainting indicators - there is no way you can know the "current future values" (values that will be future values for a current bar, and that is the reason why current (ndots values in case of the indicator you posted) will repaint and change as new bars are formed)

There are some mathematical methods that are using that future values too (SSA, Hodrick-Prescott filter (just t remind that Edward Prescott is a Nobel prize winner in economy)), but none is using just the future values in in its calculation . Using only future values in calculation is usually considered (and is) a coding error

hope this helps a bit considering future value usage in calculations

annbeea:
just from my non-coder raw silly guess thinking, i guess using future values may has its merit, because when for example the trend still up, when the most recent data still support "up" direction, then the indicator can still stay the trend without being stop out easily.
 
ag2011:
Hi mladen.

It seems to me that you are well versed in coding. I am a complete beginner in indi's, and need your help.

I need to have this indi give the outputs of 1, and -1, when MODE 1 (or MODE 0, I really don't care at this point) is selected if at all possible PLEASE!

The outputs (1, -1) ALREADY ARE AVAILABLE in the indi, but it doesn't output those values.

You can find these outputs from this variable way down in the code; âåðõ_âíèç.

I was trying out different things with this indi and had (almost) a success, but when used with an EA that I want to have call the indi by the iCustom function, it either stalled, or did a number of strange things (during different stages of modding).

I have included the " Almost Working prototype" indi (Gann_SQ9_A4), as well as the original (Gann_SQ9_A2) for comparison.

If the current "prototype" can display the " 1 , or -1" on the chart, then I would imagine it not too hard to be able to route that signal to the indi's output? But then again - I don't know enough about indi's to be able to do this!

I really hope that you can help....

Cheers

AG

Never mind. I think I have it figured out...

AG

 
annbeea:
this seems similar to coeffoline indicator code which (may) repaint. but this one is a line version show on Chart, could you help me to fix this for its repaint issue to (1) non-repaint, (2)the "cannot" display in less than 4 digits instruments issue, add (3)colour to show buy, sell signal and add4) (an audio alert option for colour change? Many thanks for help.

could mladen help to code the one previous post here to have the above four qualities ? Many Many thanks.coeffoline_fixed.mq4

attached is another similar indicator in histogram format i search in web, but i do not know what areas it fixed for, but can act as reference.

Files:
 

Coding help..

Hey guys,

Not sure who to ask about this - but I have an EA that's currently using the wrong indicator for its trades and I need to 'swap' it for another indi. The coder that I normally pay to do these things for me has gone AWOL on me and I need to see if there's someone else out there that'll be willing to do it?

It normally takes the guy like 10 mins to do it - so I dont think it would be hard - I swap new indies for old ones often just to test things out. I'm not a coder - tried learning, but its all seriously Greek to me (no offense to my Greek friends!).

Please PM me if this does interest you - I'll be seriously happy for the help! I'll send you the EA and indi with the PM.

Oh, I am willing to pay - pls just quote me. Ofc, if someone is willing to do it for free I would be highly appreciative!

Kind regards,

edfebb

 

...

For now try out this version

It fixes some other errors too (see this example : it is EURCAD and it is obvious that the original is giving false signals - signals are in wrong direction) and is adding some functionality which makes it easier to use when it comes to signaling.

And it works on JPY crosses too (here is an example :

PS: it is not repainting now

annbeea:
could mladen help to code the one previous post here to have the above four qualities ? Many Many thanks.coeffoline_fixed.mq4 attached is another similar indicator in histogram format i search in web, but i do not know what areas it fixed for, but can act as reference.
Files:
 

CoefOfLine bars ...

As of "on chart" version, maybe better something like this :

It is probably easier to read and use this way and one can immediately check what would the results be. On the example period is set to 15

Files:
 

alert needed for Reverse Stoch histogram

Hi guys,

I would love to have an sound and arrow alert added to this indy. it works like an early warning signal, for what i am testing, but unfortunately i cannot code.

Here you see a chart with the indy.

If anyone is able to add the alerts i would be grateful.

Thanks in advance.

MQL.