This is the profit stop.
Profit = 2 * ATR(20);
ApplyStop(stopTypeProfit, stopModePoint, Profit, 2);
This is the stop loss.
Loss = 1 * ATR(20);
ApplyStop(stopTypeLoss, stopModePoint, Loss, 2);
Is there anyway that can be plotted on a chart?
Thanks wysiwyg. Is there anyway that can be plotted on a chart?
BuyPrice = Param("Enter Buyprice", 0, 0, 100, 0.005);
Profit = 2 * ATR(14);
ExitA = SelectedValue(BuyPrice + Profit);
Loss = 1 * ATR(14);
ExitB = SelectedValue(BuyPrice - Loss);
ProfitLine = LineArray(BarCount - 100, ExitA, BarCount-1, ExitA);
StopLossLine = LineArray(BarCount - 100, ExitB, BarCount-1, ExitB);
Plot(ProfitLine, "Profit", colorBlue, styleLine|styleThick);
Plot(StopLossLine, "Loss", colorDarkRed, styleLine|styleThick);
Buy = A Winner;
Sell = A Loser;
Profit = 2 * ATR(14);
ExitWin = BuyPrice + Profit;
Loss = 1 * ATR(14);
ExitLoss = BuyPrice - Loss;
Filter = Buy;
AddColumn(Close, "Price", 1.3, colorSeaGreen);
AddColumn(ExitWin, "Profit Price", 1.3, colorBlue);
AddColumn(ExitLoss, "Loss Price", 1.3, colorDarkRed);
MIperiod = 14;
ADXperiod = 14;
PDIValue=PDI(MIperiod);
MDIValue=MDI(MIperiod);
DX=100*abs(PDIValue-MDIValue)/(PDIValue+MDIValue);
FinalADX=EMA(DX,ADXperiod);
PositionScore = FinalADX;
What value gets assigned to PositionScore? The last value in the array?
MIperiod = 14;
ADXperiod = 14;
PDIValue=PDI(MIperiod);
MDIValue=MDI(MIperiod);
DX=100*abs(PDIValue-MDIValue)/(PDIValue+MDIValue);
FinalADX=EMA(DX,ADXperiod);
PositionScore = FinalADX;
Filter = 1;
AddColumn(FinalADX , "FinalADX");
T
PositionScore values rank from lowest to highest so tickers with lowest FinalADX are ranked before higher FinalADX. Backtest output shows positionscore values as well.
I tested the position score again and it seems as though the highest value takes precedence.
Unfortunately, there does not seem to be a lot of information about positionscore.
However, Auto Analyser keeps telling me that there is no buy/sell variable assegments...My code (simplified) as follows:
KS=(HHV(H,26)+LLV(L,26))/2;
TS=(HHV(H,9)+LLV(L,9))/2;
Buy = Cross(TS,KS);
You need to add:
Sell = your sell statement here;
to your formula.
I see. I thought that setting SL and TP in Settings tab will take of it - the order will be close at either stop loss or take profit targets...
If I need to specify sell do I also need to specify stop loss level?
Thanks in advance Cap.
Sell = 0;
If you only want to exit using built-in stops then add:
to your formula.Code:Sell = 0;
What are the commands to get a price at buy - buyprice?
SetTradedelays(1,1,0,0);
BuyPrice = Open;
And also the date of the candle at which buy signal occured?
Can I suggest a read of the Portfolio backtest tutorial before going too much further down the backtesting path.
http://www.amibroker.com/guide/h_portfolio.html
Captain,
I went through tutorial and still confused about the difference between raw and actual signals
I've managed to put a small amount of code together for backtesting Ichimoku system however even in the presence of clear buy signals (I'm only backtesting long now) the system does not generate any buy signals (although some raw signals are visible)... So at the moment I'm trying to figure out why the system does not buy.
Post your code and we'll have a look and try to help
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?