Hi all,
I am a newbie, so please forgive me if my questions are very elementary.
I am writing a function that will scan all open orders and if conditions are met, for each of them opens an hedge grid every "x" pips (i.e. if I have a buy order, it creates SellStop orders every "x" pips).
The grid is opened correctly, BUT, everytime, altready processed orders are taken in account, so it creates again an hedge grid.
I put a LastCoverageLong variable that stores the OpenOrderTime of last processed orders, and I check it when selection the orders to cover, but it get reset at the begin of the function... I can't understand why.
can you please help?
thanks a lot
eros
yes, that is exactly what is happening. so what should I do to prevent this? how to define and manage it as global variable?
If I define as global variable, should I pass it to the function when call it? and should the function return back a value?
yes, that is exactly what is happening. so what should I do to prevent this? how to define and manage it as global variable?
If I define as global variable, should I pass it to the function when call it? and should the function return back a value?
just to let you know, I solved using globlal variable, passing it to the function and expecting back a datetime result that is stored in the global variable.
this is working now, thanks
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I am a newbie, so please forgive me if my questions are very elementary.
I am writing a function that will scan all open orders and if conditions are met, for each of them opens an hedge grid every "x" pips (i.e. if I have a buy order, it creates SellStop orders every "x" pips).
The grid is opened correctly, BUT, everytime, altready processed orders are taken in account, so it creates again an hedge grid.
I put a LastCoverageLong variable that stores the OpenOrderTime of last processed orders, and I check it when selection the orders to cover, but it get reset at the begin of the function... I can't understand why.
can you please help?
thanks a lot
eros