IFocus
You are arguing with a Galah
- Joined
- 8 September 2006
- Posts
- 7,668
- Reactions
- 4,758
I lost the key awhile ago and this is what AB told me to do. I have removed the link code obviously and I don't know if it will trigger any memories for you so good luck with it.
k =Optimize("k",Param("k",2,0.25,4,0.1),0.25,4,0.1);
per = Optimize("per",Param("per",5,1,24,1),5,24,1);
filt = ATR(per)*k ;
Lo = 0;
Hi = H + 2*filt;
for(i = 2; i < BarCount; i ++)//2
{
if(i == 2) trend[1] = 1;
if(trend[i-1] == 1)
{
LoN = L[i] - filt[i];
if(LoN > Lo[i-1])
{
Lo[i] = LoN;
}
else
{
Lo[i] = Lo[i-1];
}
if(L[i] < Lo[i])
{
trend[i] = 0;
Hi[i] = H[i] + filt[i];
}
else trend[i] = 1;
}
if(trend[i-1] == 0)
{
HiN = H[i] + filt[i];
if(HiN < Hi[i-1])
{
Hi[i] = HiN;
}
else
{
Hi[i] = Hi[i-1];
}
if(H[i] > Hi[i])
{
trend[i] = 1;
Lo[i] = L[i] - filt[i];
}
else trend[i] = 0;
}
}
Hi = IIf(!trend, Hi, Null);
Lo = IIf(trend, Lo, Null);
Plot( Close,"Price",colorBlack,styleBar);
Plot( Hi, "hi", colorGreen );
Plot( Lo, "lo", colorRed );
Anyone know how to implement two ApplyStop functions in one strategy please?
There needs to be a function that links the Long trailing stop to the Buy and the Short trailing stop to the Sell. After +10 hours of searching archives I have not found the answer. From what I am experiencing, the ApplyStop function can't be isolated to one variable.
Buy = yyy;
Sell = 0;
Short = mmm;
Cover = 0;
Swap = Flip(Buy, Short);
LongTrail = 5 * ATR(14);
ShortTrail = 3 * ATR(14);
ApplyStop(stopTypeTrailing, stopModePoint, IIf(Swap, LongTrail, ShortTrail), 2);
Could someone please help me with this formula.
I want to code a profit stop for "entry plus 2 x 20ATR from the entry" and a failure stop at "entry minus 1 x 20 ATR".
The profit stop is not a trailing stop just a set target of the entry price plus 2 times 20ATR.
Any help appreciated. Having a lot of trouble.
Thanks
Hi all, I just ordered the Amibroker Pro and now try the Premium Data, but it looks like there is something wrong with the watchlist in the premium database. When I expand the "Watchlist" in the "Symbols" tab, there are a lot of invisible watchlists (name is blank) in the beginning (the first visible watchlist is "Absolute Return Funds"). I could not rename the invisible watchlist and no Pop-Up Menus appear when I left click on it.
I would like to make my customized watchlist, and I suppose these invisible watchlists are actually made for that purpose, just can someone let me know how to make them customizable?
Thanks!
I just found that the watchlist could be modified by editing the file "index.txt"
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?