Simple Coding Help - No Promise.

Dear, how can we find a specific range bound candle in simple AFL style IN LAST FEW CANDLES, I need high, low and wants a name of that candle. in c++ we can find easily but i need without c++, please help c++ example is :-
RANGE= REF(H-L ,-1) < REF(H-L,-2);
H1=0;
L1=0;
H1bar=0;
for( i = BarCount-2; i <= BarCount-1; i++ )
{
if(RANGE)
{
H1=H;// HIGH of that candle
L1=L ;//LOW of that candle
H1bar=i;// name of that candle
}}
 
Last edited:
How can i backtest in Amibroker for a bracket order on "LAST PRICE" instead of "CLOSE" price as per the case below:

SL and target defined for a buy/sell trigger. But both occur in the very next candle (same candle) and Backtest is giving result as per CLOSE of the candle not as per actual price to determine whether SL or Target , which one triggered first.

Pls help to code this as i am stuck on this for a longtime.
Thanks in advance!
 

trash

Well-Known Member
How can i backtest in Amibroker for a bracket order on "LAST PRICE" instead of "CLOSE" price as per the case below:

SL and target defined for a buy/sell trigger. But both occur in the very next candle (same candle) and Backtest is giving result as per CLOSE of the candle not as per actual price to determine whether SL or Target , which one triggered first.

Pls help to code this as i am stuck on this for a longtime.
Thanks in advance!

Use greater granularities than your to be observed interval in order to look inside bar! 1-min, 1-sec, 1-tick,... you name it.

Also if you would use ApplyStop then check settings.
www.amibroker.com/guide/afl/applystop.html

Alternatively to using ApplyStop you may use looping for creating your custom stops.
 
need some help...

i used to have "Color" on pinbars (like green on higher and red on lower) in my amibroker. i had to reinstall OS and reinstalled amibroker. now, all i see is black pinbars.

i forgot what i did last time. can someone help me with this.
i want to see my chart like this.
 

Similar threads