Hi @WooBack,I have been having trouble finding a way to save previous values on afl.
Eg.
A = AA == AB;
A_Price = valuewhen(A,C);
How do i get the previous A_Price values?
SYNTAX | ValueWhen(EXPRESSION, ARRAY, n = 1) |
---|---|
EXAMPLE | valuewhen( cross( close, ma(close,5) ) ,macd(), |
Not entirely clear on what you're trying to achieve so apologies if my response is wrong.I have been having trouble finding a way to save previous values on afl.
Eg.
A = AA == AB;
A_Price = valuewhen(A,C);
How do i get the previous A_Price values?
Thanks Rob this helped!Hi @WooBack,
I'm not strong on afl but see if the suggestion below works any better.
A_Price = ValueWhen(A,C,2);
ValueWhen - get value of the array when condition met
SYNTAX ValueWhen(EXPRESSION, ARRAY, n = 1) EXAMPLE valuewhen( cross( close, ma(close,5) ) ,macd(),
Cheers, Rob
Thanks!Not entirely clear on what you're trying to achieve so apologies if my response is wrong.
To get previous A_Price value you can declare it as an array and then simply call ref(APrice, -n), where -n is the "lookback bar count" for how far back you want to retrieve the value of A_Price
Wondering if anyone can help with the above issue. Thanks in advance to the helpful Amibroker lot.First off, im not sure if this is the right place to post this question. If it belongs somewhere else please move it.
for you who are using Amibroker, after you have placed your buys, how do you keep track of when to sell in Amibroker?
the issue i have is that i run an Exploration, find my buys but im not sure on how to keep track of them. I have a trailing stoploss and a max stoploss but for some reason the stoploss plot doesnt always show up on the chart. If i run the Exploration only one in a few show, in a backtest scan with the same rules the stoploss shows up more often than not. Im guessing there is a better way t keep track of your buys. Maybe code everything in an Exploration including the stoploss triggers, that way, all i need to do is run an Exploration and i can have all the info there, no need to look at the charts.
what are your thoughts on this?
Hello and welcome to Aussie Stock Forums!
To gain full access you must register. Registration is free and takes only a few seconds to complete.
Already a member? Log in here.