Originally Posted by AndrewAMD
Rewrite your script so that it is not causing trade loop recursion. TLR causes all kinds of nasty side effects.

Hi AndrewAMD, thank you for your quick replyπŸ‘. I found out if the checking function (lastTradeFail) return true, and the main process start a new position, then the TLR warning will show up.

Am I wrong in the process?

Code
                if(crossOver(Signal,Threshold)){
			if(Price[0]>MySignal[0] || lastTradeFail("long",3600*24*2,true)==1){
				if(lastTradeFail("short",3600*24*2,false))
					return;
				enterShort();
			}
		}

Attached Files
loop_recurision.png (64 downloads)
Last edited by AdamWu; 07/26/20 01:42.