Hello! I'm new to AFL
I've read a lot of articles and as a beginner, it's still hard for me to understand everything.
I ran into a small problem, could you help me.
How can I create a variable that will count the number of conditions.
Filter = 1;
count = 0;
IIf(Buy, count ++, count + 0);
AddColumn(count, "Buy Count", 1.1, colorGreen);
my backtest report shows that the purchase condition was met 3 times
so there should be 3 in count
but the code i'm trying to do shows me only 1
I want to do this in order to display only what matches my condition in the report.
for example : AddColumn(count >= 3, "Buy Count", 1.1, colorGreen);
Tomasz
May 10, 2022, 11:20am
#2
Use Cum() function
AddColumn( Cum( Buy ), "Cumulative Buys" );
thanks for the answer. I tried to do as you said. and this is what i got
target_profit = 83;
//----------------------------------------------------------------------------------------------------
Buy = Close <= Second_down;
Sell = 0;
//----------------------------------------------------------------------------------------------------
Short = 0;
Cover = 0;
//----------------------------------------------------------------------------------------------------
profit_stop = ApplyStop( stopTypeProfit, stopModePercent, Param("profit", target_profit, 1, 100, 1), True );
//----------------------------------------------------------------------------------------------------
Filter = 1;
AddColumn( Cum( Buy ), "Cumulative Buys" );
backtest have 3 count
this my explore
where did i make a mistake?
Exploration is not equal to backtest.
You get raw signals in your exploration.
Read about differences here:
INTRO
The post summarizes in tabular form the differences between different Analysis modes namely: Scan, Exploration and Backtest.
First and foremost thing to understand is that these three modes serve different and distinct purposes and they by their nature are meant to display different things.
SCAN
The Scan is meant as a quick tool to show raw, unprocessed, non-delayed signals as they are present in Buy/Sell/Short/Cover arrays. Scan does not do ANY processing. Output of scan is not custom…
1 Like
Not correct as usual.
Why are you newbies always make false claims stated as facts?
If you don't know then say so but please stop stating incorrect things.
You can add whatever column you want to backtest result list (or additional info to backtest report).
This is just one example
Backtesting engine in AmiBroker allows to add custom metrics to the report, both in the summary report and in the trade list. This is possible with Custom Backtester Interface, which allows to modify the execution of portfolio-level phase of the test...
https://www.amibroker.com/guide/a_custombacktest.html
1 Like
in which of my posts did I make a false statement?!
I was just asking a question, not stating
Well, it is not really a clear question.
Questions are like
"Does it mean that...?"
"Am I right that...?"
Yours is "it turns out that I can't do this or that..." so it is rather more of a statement than question.
1 Like
If I seemed rude to you, then I want to apologize. I do not know English, I write through Google translator, and it is possible that he translates something incorrectly. Well, as someone who doesn't know English, it's very difficult for me to delve into AFL
but I know that I can still do it.
system
Closed
August 19, 2022, 9:59am
#10
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.