thx. I tried to change the code to use open price, but then it has 80% win instead of 100%, I am still thinking where is the problem:
SetPositionSize( 100, spsPercentOfEquity );
acc = 0.02;
accm = 0.2;
sarc = SAR( acc, accm );
Buy = Sell = 0;
Short = Cover = 0;
YourBuyConditions...
hi and thx. I asked you before how to do these:
How to change this AFL codes to
Sell =(SAR() > C) + "only sell if the price is higher than the bought price"?
You told me to try sellPrice>BuyPrice;
Here is my code:
Buy = BuyPrice>=L AND BuyPrice<=H AND Cross(Open,SAR());
Sell...
I am still very confused that does the "C" in cross(C,SAR()); means current price or close...
If I want to just buy when the SAR cross within the price between day high and low (which is all possible price within that day), does it make sense to have cross(C,SAR());? Is there a way to use the...
Hi, may I know these:
1. I think C in cross(C,SAR() means using close price to do the cross, if I use cross(Open,SAR()). then I use the open price to compare with the SAR at the open price right? I guess SAR in amibroker would not always use the close SAR even I do the (Open, SAR())?
2. Even...
thx and I will try this once I get back to home. By the way I found out that the default SAR in Amibroker may has bug. I set the SAR to SAR(0.1,1) and apply to index history with around 10000 - 25000 range normally, and there are always having the exact same SAR in the day right after the SAR...
I tried this before but it doesn't work. My codes above would always have either buy or sell signal. Let's say bar 1 is a buy signal, then 100% buy in, then coming bar 2, bar 3, bar 4 all are raising and there are buy signal for these bars too. Then in bar 5, there is sell signal, but then the...
How to change this AFL codes to
Sell =(SAR() > C) + "only sell if the price is higher than the bought price"?
Here is the code:
Buy = SAR() < C;
Sell =SAR() > C;
BuyPrice = SAR() + 0.01;
SellPrice = SAR() - 0.01;
SetPositionSize( 100, spsPercentOfEquity );
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.