Requests & Ideas - page 268

Mladen Rakic
163384
Mladen Rakic  
pooh123:
Hi Mladen,

Happy New Year !

Here's a new request (I didn't give you much break recently). Can you please create an indicator that works this way

For a bar-

1) If a tick price is higher than the previous tick price, we call it an Up Tick. If a tick price is lower than the previous tick price, we call it a Down Tick. We call the price difference between any two adjacent Up Ticks “ Up Tick Difference”; We call the price difference between any two adjacent Down Ticks “Down Tick Difference”.

Sum up the absolute value of all Up Tick Differences for the bar and we call it Up Tick Difference Total; sum up the absolute value of all Down Tick Differences for the bar and we call it Down Tick Difference Total.

2) Divide the Up Tick Difference Total by number of Up Ticks of the bar ; divide the Down Tick Difference Total by number of Down Ticks of the bar. The two values we get from the divisions become the outputs of the indicator.

Thank you in advance,

pooh

pooh

That can be done only for ticks when the indicator starts to work on some time frame /symbol ( runtime data - there is no historical ticks data and it can not be reconstructed for the past). Is that what you had in mind?

poohguo
231
poohguo  
mladen:
pooh That can be done only for ticks when the indicator starts to work on some time frame /symbol ( runtime data - there is no historical ticks data and it can not be reconstructed for the past). Is that what you had in mind?

Mladen,

Yes, I expected that.

pooh

poohguo
231
poohguo  
pooh123:
Hi Mladen,

Happy New Year !

Here's a new request (I didn't give you much break recently). Can you please create an indicator that works this way

For a bar-

1) If a tick price is higher than the previous tick price, we call it an Up Tick. If a tick price is lower than the previous tick price, we call it a Down Tick. We call the price difference between any two adjacent Up Ticks “ Up Tick Difference”; We call the price difference between any two adjacent Down Ticks “Down Tick Difference”.

Sum up the absolute value of all Up Tick Differences for the bar and we call it Up Tick Difference Total; sum up the absolute value of all Down Tick Differences for the bar and we call it Down Tick Difference Total.

2) Divide the Up Tick Difference Total by number of Up Ticks of the bar ; divide the Down Tick Difference Total by number of Down Ticks of the bar. The two values we get from the divisions become the outputs of the indicator.

Thank you in advance,

pooh

Hi Mladen,

Sorry that I need change the logic for "Up Tick Difference" and "Down Tick Difference". This is the logic I need it to be:

Up Tick Difference= price of an Up Tick - price of the previous tick

Down Tick Difference= price of a Down Tick - price of the previous tick

The rest remain unchanged.

pooh

Mladen Rakic
163384
Mladen Rakic  
pooh123:
Hi Mladen,

Sorry that I need change the logic for "Up Tick Difference" and "Down Tick Difference". This is the logic I need it to be:

Up Tick Difference= price of an Up Tick - price of the previous tick

Down Tick Difference= price of a Down Tick - price of the previous tick

The rest remain unchanged.

pooh

pooh

Try this one out (I tested it in visual back test and it seems to be working OK). One option added : SameSide. If it is set to true the values are drawn on the same side of 0 (like the upper values on the example picture), otherwise it will show values like on the lower example. Also an option to use total ticks per bar or just the number of ticks that were up or down added

_____________________

PS: I guess that the results are going to look quite different at run-time than in this visual back test (this results are just showing how visual back test works, not how the real data looks like)

Files:
blueeagle
948
blueeagle  

Merry Christmas, mladen.

Does this indicator requires adjustment for use in an EA?

Regards,

Paul

Mladen Rakic
163384
Mladen Rakic  
tamaraofx:
Merry Christmas, mladen.

Does this indicator requires adjustment for use in an EA?

Regards,

Paul

Paul

I am not sure that I understand the question

If the question is if the indicator needs some code changes so that it can be used from an EA, the answer is : no, no code changes needed for that indicator. It can be used from an EA perfectly well as it is now

blueeagle
948
blueeagle  
mladen:
Paul

I am not sure that I understand the question

If the question is if the indicator needs some code changes so that it can be used from an EA, the answer is : no, no code changes needed for that indicator. It can be used from an EA perfectly well as it is now

Thanks, mladen. I used that indicator in an Ea but the EA runs so slow. That's why I asked. And because I've seen some of your indicators been revised for use in an ea.

Thanks again.

Paul

Mladen Rakic
163384
Mladen Rakic  
tamaraofx:
Thanks, mladen. I used that indicator in an Ea but the EA runs so slow. That's why I asked. And because I've seen some of your indicators been revised for use in an ea.

Thanks again.

Paul

Paul

Do not forget the first parameter (the TimeFrame). Use "" in iCustom() call as a first parameter and it should work OK (if you omitted that parameter it will run very slow and will return wrong results)

Mladen Rakic
163384
Mladen Rakic  
tamaraofx:
Thanks, mladen. I used that indicator in an Ea but the EA runs so slow. That's why I asked. And because I've seen some of your indicators been revised for use in an ea.

Thanks again.

Paul

Paul

This is the correct way to call that indicator :

double currentTrend = iCustom(NULL,timeFrame,IndicatorFileName,"",SmoothPeriod,SmoothPhase,2,barToTest);

If currentTrend is == 1, trend is up, if it is -1 trend is down

blueeagle
948
blueeagle  
mladen:
Paul

This is the correct way to call that indicator :

double currentTrend = iCustom(NULL,timeFrame,IndicatorFileName,"",SmoothPeriod,SmoothPhase,2,barToTest);
If currentTrend is == 1, trend is up, if it is -1 trend is down

Thanks, mladen.

I felt there was something wrong with my code/signal. I was using buffer 0 and 1 for blue and red lines. I am actually using crossover buy when blue is above/greater than red (and previous red above blue). For additional position, I used when blue is > than red and supersignal paints green then buy (vice versa for sell). It was making some trades but I knew there is something wrong. Please see the chart and give me correct signals/codes.

Thank you very much.

Paul