NexusFi: Find Your Edge


Home Menu

 





Amibroker ignoring signals generating in previous candles


Discussion in Platforms and Indicators

Updated
    1. trending_up 944 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 1 attachments




 
Search this Thread

Amibroker ignoring signals generating in previous candles

  #1 (permalink)
Velocityyogi
MP + India
 
Posts: 1 since Aug 2018
Thanks Given: 0
Thanks Received: 0

Below is my code:

st = SuperTrend(10,3);

_x = TimeFrameGetPrice("H", inDaily, -1);
_y = (_x * 1.009);
_z = TimeFrameGetPrice("H", inDaily );

cond1 = Cross(C, st);
cond2 = _z > _y;

Buy = cond1 AND cond2;
Sell = Cross(st, C) ;

Plot(_y, "PDaysH", colorGold,styleDashed,0,0,0,0,0);
Plot(_z, "PDaysH", colorOrange,styleDashed,0,0,0,0,0);
Plot(st, "STOP", IIf(C>st,colorBrightGreen,colorRed),styleLine|styleStaircase|styleThick); //ploting highlow

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone), colorGreen, 0,L, offset=-120);

Problem I am facing is if cond2 gets satisfied in future, signal gets generated on previous signal candle (at right place) can anyone guide on how to ignore that. I want signal should be generated only if its a latest candle and both conds are true. In the attached file you can see that cond2 turns true after 3 candles from cond1 and buy signal turns true at the place of cond1 == true.


Reply With Quote




Last Updated on December 2, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts