Reply

creating simply pivot indicator

5 replies

mcsabee

Subscriber, bbp_participant, community, 7 replies.

Visit profile

9 years ago #112146

Hi fellow programmers and traders,

 

I am struggled trough the signal indicator wich I would create: it’s a very simple pivot indicator wich gives a high signal when any candle has two lower lows either side of it and two lower highs either sides of it.

A low signal opposite, any candle that has two higher highs and two higher lows either side of it.

I attached a picture of it. Unfortunatelly the indy what I created does not follow that rules (also attached a picture).

Anybody has an idea where I made the mistake?

Second question, that I found a topic here in the forum how to move signal arrows closer to price bar, but still challenging me how to do it. Possible to show me with example?Maybe with this pivot indicator?

Thanks in advance.

 

Csaba

 

0

mcsabee

Subscriber, bbp_participant, community, 7 replies.

Visit profile

9 years ago #124570

Hello,

 

Any help for this signal indicator? Several times I get the correct signal, but after I get an indication incorrectly.

And please, any help to move signal arrows closer to bar?

When I use rules in custom functions: “void sqDrawUpArrow(int shift”) and “void sqDrawDownArrow(int shift)” I get errors in mt 4editor.

Thanks your help.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

9 years ago #124592

Hello,

 

I checked this.

 

 

 

any help to move signal arrows closer to bar?

 

 

 

yes, in the EA find row with:

atrOffset = 0.5 * iATR(NULL, 0, 10, 1);

 

and change 0.5 to 0.1

 

 

Secondly, I think your rules are too difficult, but they might work too. I’m attaching sqw with simpler rules.

 

Thirdly, indicator doesn’t use actions from THEN part, so you cannot tell it to draw arrows 2 bar back.

The solution is to edit the EA again, find the function drawSignal() and add +1 after the i:

 

void drawSignal(int signalIndex, int i, double value) {
   if(signalIndex == 1) {
      Signal1Buffer[i+1] = value;
   }
   if(signalIndex == 2) {
      Signal2Buffer[i+1] = value;
   }
}
 
This moves the signal points one bar back, then it should work as you expect.

Mark
StrategyQuant architect

0

mcsabee

Subscriber, bbp_participant, community, 7 replies.

Visit profile

9 years ago #124603

Mark,

 

Thanks for answer and your help. I made the changes what you adviced, but unfortunatelly the signal indicator still does not follow the rules.(Pls see attachement)

 

Regards,

Csaba

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

9 years ago #124615

Hello,

 

I tested the indicator and it seems to me it is working correctly.Can you show me the error on a screenshot?

Mark
StrategyQuant architect

0

mcsabee

Subscriber, bbp_participant, community, 7 replies.

Visit profile

9 years ago #124625

Mark,

 

Please see in attachment. I marked in blue arrow the pivot highs/pivot lows. I also noticed, that is not possible to move indication dots/arrows even closer to the bar? I mean exactly end of the candle high/low?

 

Many thanks for your help,

 

Csaba

0

Viewing 5 replies - 1 through 5 (of 5 total)