Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 13:32:52 +0000



Post From: Custom Study - performing code once per bar

[2013-04-29 22:36:31]
ejtrader - Posts: 688
Josh - Do you want the line to be drawn at the Open Tick of the bar? if so - I typically use the current logic:



int& lastIndex=sc.PersistVars->i1;

if ( lastIndex == 0 )
{
lastIndex=-1;

// Any other One-Time Initiation Commands
}

int i=sc.Index;

if (i == lastIndex) return; // Everything gets processed on very first tick of the bar ONLY and then the control would return back

lastIndex = i;

// Draw Line logic;




Date Time Of Last Edit: 2013-04-29 22:50:27