Easylanguage help

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Easylanguage help

Postby nuno-online » 14 Apr 2007

Hi,
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;
2. If rule one is met, today (day one) must be either an inside day or an NR4 day. When both rules one and two are met, we now have a setup.

Code: Select all

Setup = (HVRatio < 0.5) and NarrowRange and InBar;
3. On day two, place a buy-stop one tick above the day-one high and a sell-stop one tick below the day-one low.

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

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

Is there someone who can help me ?

Postby nuno-online » 16 Apr 2007

Is there someone who can help me coding this in easylanguage?
i don't you how to do

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.


thank you
Nuno

Guest

Postby Guest » 16 Apr 2007

You could try this:

If Marketposition=1 then begin //buy-stop is filled
if date=entrydate //only at entrydate
SellShort at (Low-1Tick) Stop
else
Sell at (mytrailingstop) Stop;

end;

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

your solution

Postby nuno-online » 18 Apr 2007

thank you "Guest"

I will try your solution.
I think i have to do the same with marketposition=-1 ?

Nuno


Return to “MultiCharts”