View Single Post
  #9 (permalink)  
Old 12-06-2006, 03:56 AM
auto's Avatar
auto auto is offline
Senior Member
 
Join Date: Jan 2006
Location: Tokyo
Posts: 237
auto is on a distinguished road
Exclamation

Quote:
Originally Posted by Kurka Fund
Need some Help with Functions:

How do I

Get CheckForOpen() to open only one position per bar?
Stop Opening of a position once it has been closed ?
Thanks For you Help
you have to keep track of last orderopen time ..

//this is pseudo code ..
//find the last open order ..

//loop through open orders
lastOpenTime=OrderOpenTime(); //from open

//loop through history
lastCloseTime=OrderCloseTime(); //from History

if((itime(..)-lastOpenTime)>Period()*60 && (itime(..)-lastCloseTime)>Period()*60 )
{
CheckForOpen();
}

at least you are trying .. that's good.

regards
Reply With Quote