I'm attempting to write a snippet that checks if a new trade shut, and if that is true it will export some worth.

My code looks like this:

Inserted Code datetime current=0; Inserted Code #91;abandoned #93;complete = OrdersTotal(); #91;abandoned #93;if(complete gt; 0) current = CurTime(); if(current! = CurTime()) FILE_WRITE #91;/abandoned #93; #91;/left#93;


I tried some distinct sulotions, both discovered here on the forum and at Meataqoutes homepage, but I can't get anyone to operate properly. My idea is the set a variabel with the date when a position is open (orderstotal gt; 0 ) and compare this to the current time ( when a position isn't available, the variabel is going to have an old worth an thereby is not equal to CurrentTime() ).

Instead, I get the ea to write to the document every volume-change once an position is available.

What have I overlooked?


And, another question - is it feasible to change, at a csv export to;?