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