NexusFi: Find Your Edge


Home Menu

 





Circular Reference thru StaticVarGet/Set.


Discussion in Platforms and Indicators

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




 
Search this Thread

Circular Reference thru StaticVarGet/Set.

  #1 (permalink)
LoveenaJyothi
Mangalore,India
 
Posts: 2 since Jun 2016
Thanks Given: 2
Thanks Received: 0

Is Circular Reference possible in AFL ?
Tried StaticVarGet & Set , got desired results along with a lot of garbage AND utterly UnReliable in Live Trade bcoz everytime Explore/Scan/Backtest Button Clicked --> the AFL gives Different results each time.

Sample codes:
1.Basic Code
 
Code
Buy=Buycondn;
Sell=SellCondn dependent on BuyCondn;
Short=ShortCondn OR Ref(Sell,-1);
Cover=CoverCondn dependent on ShortCondn;
//Wud love to define Buy=BuyCondn OR Ref(Cover,-1),  but obviously will not work, so tried the below code
2.Modified Code.
 
Code
TempCvr=StaticVarGet("TempCvr");
Buy=Buycondn or TempCvr;
Sell=SellCondn dependent on BuyCondn;
Short=ShortCondn OR Ref(Sell,-1);
Cover=CoverCondn dependent on ShortCondn;
TempCvr= Ref(Cover,-1) ;
StaticVarSet("TempCvr",TempCvr,persist=True);
This Modified code gives, as desired, the Buy Signals @ bar next to Coverbar on chart , but in Analysis window , for every click it gives a diffrent result, especially if AllSymbols or more than 1 symbol is selected,
if CurrentSymbol is selected, the Results are Stable after the second or third clicks.

Plz Note: the ExRems are duly placed, no question of excess signals.

Any Insights by Respected Seniors/Coders wd be Highly Appreciated.

Thank You all.
LJ.

Reply With Quote




Last Updated on November 4, 2016


© 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