You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have some code that depends on the number of candles that have elapsed since a trade was opened.
I set a global variable when a position is opened
First_Pos_time=Time[0];
Then when the next position is opened i calculate the number of candles that have elapsed by
Exit_MA_Shift= MathRound((Time[0]-First_Pos_time)/60/Time_Frame);
where Time_Frame=15 for a 15 minute chart.
So Exit_MA_Shift should equal the number of candles that have elapsed since the first trade was opened.
It seems to work, except when it goes over the weekend. Does anyone have an idea how I can exclude the time over the weekend from the candle calculation, and know when to do it.
Thanks
surveyman