Reply To: Variant Of Weis Wave

Optuma Forums Optuma Scripting Variant Of Weis Wave Reply To: Variant Of Weis Wave

#53025
Kim
  • Topics: 1
  • Replies: 5
  • Posts: 6

Trevor thanks so much for your assistance. I had derived a workaround but your script is better. Shannon from what i can see you are not deleting the parts of the script that Trevor has replaced. I also took Mathews advice re removing and replacing –

The revised script is then

PSW = PERCENTSWING(PERCENT=10, DEFAULT=SwingList, COLOURSTYLE=Up/Down);

PSWStart= SWINGSTART(PSW);

PSWEnd = SWINGEND(PSW);

Rng = PSWStart – PSWEnd;

// Down Swings bars

Sig1 = if((TIMESINCESIGNAL(PSWStart) > 0 and Rng > 0) , 1, 0);

Sig2 = IF(TIMESINCESIGNAL(PSWStart) > 0 and Rng < 0, -1, 0) ;

//Sig3= If(Sig1 or Sig2, 1, 0);

// Up Swing Bars

//Sig4 = if((TIMESINCESIGNAL(PSW) > 0 and Rng < 0), 1, 0);

//Sig5= IF(TIMESINCESIGNAL(PSWEnd) < 1 and Rng > 0, 1, 0) ;

//Sig6= If(Sig4 or Sig5, 1, 0);

// Plot the Down trend Volume

Plot1 = If(Sig1, ACCSINCESIGNAL(Vol(), Sig1), 0) ;

Plot1.Colour = Red;

Plot1.Plotstyle = Histogram;

Plot1.LineWidth = 5;

Plot1.LineStyle = Solid;

// Plot the Up trend Volume

Plot2 = If(Sig2, ACCSINCESIGNAL(Vol(), Sig2), 0) ;

Plot2.Colour = Green; Plot2.Plotstyle = Histogram;

Plot2.LineWidth = 5;

Plot2.LineStyle = Solid;

The screenshot attached is 5 percent swing

Pin It on Pinterest