I am trying to plot the TradeStopLimit as a visual comparison between what we want vs what the computer is actually doing. I have no problem with one Forex pair and it works great....

[Linked Image]

However, if I use a portfolio of pairs it uses the previous pair' s TradeStopLimit instead of the AssetBox pair. I have tried a number of filters to remove this relationship but no luck.

[Linked Image]

Code
// TradeStopLimit Sandbox ///////////////////////
function run() 
{
	set(PLOTNOW);
	LookBack  = 0;
	StartDate = 20190605;
	EndDate   = 20190610;
	BarPeriod = 30;

	while(asset(loop("GBP/USD","EUR/USD")))
	// while(asset(loop("EUR/USD")))
	{
	vars Prices = series(price(0));
 
	Stop = 20*PIP;
	Trail = 5*PIP;

		printf("\n%s************************************** %s %s %.5f L%d S%d",strdate(YMDHMS,0),Asset,AssetBox,(var)TradeStopLimit, NumOpenLong,NumOpenShort);

		if(strcmp(Asset,AssetBox)==0)
			if(NumOpenLong+NumOpenShort > 0)
		{
			printf("\n%s$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ %s %s %.5f L%d S%d",strdate(YMDHMS,0),Asset,AssetBox,(var)TradeStopLimit, NumOpenLong,NumOpenShort);
		plot("Stop",TradeStopLimit,MINV,PURPLE);
		}
		
	if(Asset=="GBP/USD")
	{
	if (ltod(UTC,0) == 0200)
      enterLong();
	if (ltod(UTC,0) == 1500)
      enterShort();
	}

	if(Asset=="EUR/USD")
	{
	if (ltod(UTC,0) == 0900)
      enterLong();
	if (ltod(UTC,0) == 1900)
      enterShort();
	}}}



Last edited by Figurehunter; 01/26/21 16:14.