[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Limiting action to only once per bar


  • Date: Wed, 06 Jan 2010 21:52:45 -0000
  • From: "wolfie125" <lurama125@xxxxxxxxx>
  • Subject: [amibroker] Limiting action to only once per bar

PureBytes Links

Trading Reference Links

Hi, I have an indicator that basically plots the number of contracts i need to be long or short. When the number changes for a new bar, i want to run a piece of code, let's say a messagebox, or a little external program, but what is happening is once the new bar comes and the number of contracts changes this code keeps on executing 100's of times till the next bar arrives. I have tried setting a boolean variable but no success. I specifically dont want to use the alert function as i am already using it for something else on that bar.

can someone help pls, the basic logic currently is something like this :

if ((Lasttweet == False) AND LastValue(xxxtotal)!=LastValue(Ref(xxxtotal,-1)))){

txtmsg = WriteIf(xxxtotal>Ref(xxxtotal,-1),"Just Bought "+ (xxxtotal-Ref(xxxtotal,-1)) + " contracts at " + ppp,"Just Sold "+ (Ref(xxxtotal,-1)-xxxtotal) + " contracts at " + ppp);
PopupWindow(txtmsg,NumToStr(LastValue(pebstime))+" ",100,-1,-1);

Lasttweet = true;	
	
}




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/