Openning ONLY one short or long trade at a time

Posted By: anissyo

Openning ONLY one short or long trade at a time - 03/13/21 23:53

Hello guys, i am new on this platforme, after searching for days for a software to run walk forward optimization, i finally found this zorro plateforme, the possibilities are just amazing but the documentation (just like any other documentation) is not amazing which is a normal thing be cause it's the users on the forums ho can really spread the techniiques...
i am trying to contribute for the futur users (and for myself) by posting this question :
How can i oppend only one short trade and only one long trade and ignore short signals when a short trade in open and vise versa for long trades ?


if i find a way to do this i will post it, if some one know plz help^^
Posted By: AndrewAMD

Re: Openning ONLY one short or long trade at a time - 03/14/21 03:04

MaxLong=1;
MaxShort=1;
Posted By: anissyo

Re: Openning ONLY one short or long trade at a time - 03/14/21 18:36

thank you Andrew, i used another method but your's is much simpler :


bool Trade_short_state()
{bool bool_short= false;
for(open_trades){
if(TradeIsShort == true){
bool_short= true;}}
return bool_short;
}
bool Trade_long_state()
{bool bool_long= false;
for(open_trades){
if(TradeIsLong == true){
bool_long= true;}}
return bool_long;
}



if the function return true then a trade is already in place if not i can open the trade
thank you.
© 2024 lite-C Forums