Can someone help me coding this please ? :
1. First, we will compare the six-day historical volatility reading to the 100-day historical volatility reading. We are looking for the 6/100 reading to be under 50 percent (in other words, for the six-day historical volatility reading to be less than one-half the 100 day historical volatility reading).
Code: Select all
Inputs:
HVRLength1(5), HVRLength2(100), CutOff(.50), NRLength(4);
Vars:
Setup(False), HighSetup(0), LowSetup(0),
HVRatio(0), NarrowRange(False), InBar(False),
MP(0), StopPrice(0);
{Buy and Sell Setup}
HVRatio = (VolatilityStdDev(HVRLength1) / VolatilityStdDev(HVRLength2));
NarrowRange = range = Lowest(Range,NRLength);
InBar = H < H[1] and L > L[1];
Setup = (HVRatio < 0.5) and NarrowRange and InBar;
Code: Select all
Setup = (HVRatio < 0.5) and NarrowRange and InBar;
Code: Select all
If Setup then begin
HighSetup = High;
LowSetup = Low;
Buy next bar at HighSetup Stop;
SellShort next bar at LowSetup Stop;
4. If your buy-stop is filled, place an additional sell-stop one tick below the
day-one low. (The reverse applies if your sell-stop is hit first.) This will allow
you to reverse the position in case of a false breakout. This additional
sell-stop is done on the entry day only, and expires on the close of this day. A trailing stop should be used to lock in profits on a winning trade.
How can i translate the point 4 ?
Thank you for your help
Nuno