Visually understanding Dynamic Trial Stop

Good afternoon all,

A quick question to help me understand what a dynamic trial stop using applystop will look like.

Basically, wanting to have a 40% trialstop in bull market and 10% in bear market. When switching from bear back to bull, I need the trial stop to remain fixed at the last value in the bear market until the 40% trial stop catches back up. i.e See image below:

Trialling%20stop%201

Does the dynamic applystop do that, or does the dynamic apply stop go back to a 40% level as soon as the market switches back from bear to bull. i.e See image below:

Trialling%20Stop%202

By dynamic applystop, this is the code I am talking about:

index = Foreign("^AORD", "C", True); 
indexMA = MA(index, 10); 
Bull=index>=indexMA;
Bear = index<indexMA;

stopvalue = IIf(Bear, 10, 40);

ApplyStop(stopTypeTrailing, stopModePercent, stopvalue, 2,True);

Sorry All, I forgot to mention that the Red in the Moving Average plot is the Bear Market and the Green is the Bull Market.