SGMAR update

 

Hi, I'm using the attached indicator as a supplement to my trend trading and unfortunately at the current bar sometimes the dots (which show a change in direction) appear and then disappear if price moves opposite it's intended direction. Can someone fix the code that makes the dot appear only when the specific criteria have been met? I know this will add additional lag, but basically I just don't want the dots to disappear after they have already appeared, thanks.

Files:
 
Jaquanburton:
Hi, I'm using the attached indicator as a supplement to my trend trading and unfortunately at the current bar sometimes the dots (which show a change in direction) appear and then disappear if price moves opposite it's intended direction. Can someone fix the code that makes the dot appear only when the specific criteria have been met? I know this will add additional lag, but basically I just don't want the dots to disappear after they have already appeared, thanks.

Jaquanburton

If you want to prevent current bar update, simply change the line that goes like this :

for(shift=limit;shift>=0;shift--)

to this :

for(shift=limit;shift>=1;shift--)

 
mladen:
Jaquanburton

If you want to prevent current bar update, simply change the line that goes like this :

for(shift=limit;shift>=0;shift--)

to this :

for(shift=limit;shift>=1;shift--)

Ok, I tried doing this to both lines where "for(shift=limit;shift>=0;shift--)" appear but when i try to compile I get this error message, "'\end_of_program' - ending bracket '}' expected C:\Users\HP2730\Documents\experts\indicators\SGMAR2_Alert(Jay).mq4 (89, 7)." I literally no NOTHING about coding so this could be a very simple or complex question I had no clue but any help is great, thanks.

 
Jaquanburton:
Ok, I tried doing this to both lines where "for(shift=limit;shift>=0;shift--)" appear but when i try to compile I get this error message, "'\end_of_program' - ending bracket '}' expected C:\Users\HP2730\Documents\experts\indicators\SGMAR2_Alert(Jay).mq4 (89, 7)." I literally no NOTHING about coding so this could be a very simple or complex question I had no clue but any help is great, thanks.

Ignore that last post I figured out what was wrong.

Reason: