Page 8 of 26

Re: No Nonsense Forex - Indicators

Posted: Thu Oct 27, 2022 1:48 am
by xpf2003
Centaur wrote: Thu Oct 27, 2022 1:25 am Really interesting approach, I've also done some reading and they suggest using the function SymbolInfoSessionTrade, so I came up with the following function (seems to be working so far):

Code: Select all

//+------------------------------------------------------------------+
//| Function: Check if market is Open                                |
//+------------------------------------------------------------------+
bool MarketOpen()
  {
   datetime from = 0;
   datetime to = 0;
   datetime now = TimeCurrent();
   uint session_index = 0;
   MqlDateTime today;
   TimeToStruct(now, today);
   if(SymbolInfoSessionTrade(_Symbol, (ENUM_DAY_OF_WEEK) today.day_of_week, session_index, from, to))
     {
      MqlDateTime from_time;
      MqlDateTime to_time;
      TimeToStruct(from, from_time);
      TimeToStruct(to, to_time);
      int from_time_seconds = from_time.sec + from_time.min * 60 + from_time.hour * 3600;
      int to_time_seconds = to_time.sec + to_time.min * 60 + to_time.hour * 3600;
      int now_seconds = today.sec + today.min * 60 + today.hour * 3600;
      if(now_seconds >= from_time_seconds && now_seconds <= to_time_seconds)
         return(true);
      return(false);
     }
   return(false);
  }
So you are basically checking if the current time is within the allowed trading session time for that symbol.

That is a nice idea. I can extend my code to first check if trading is allowed and then call OrderSend. If trading is not allowed, I can do what I have mentioned in my post above.

Re: No Nonsense Forex - Indicators

Posted: Thu Oct 27, 2022 2:42 am
by Centaur
xpf2003 wrote: Thu Oct 27, 2022 1:48 am So you are basically checking if the current time is within the allowed trading session time for that symbol.

That is a nice idea. I can extend my code to first check if trading is allowed and then call OrderSend. If trading is not allowed, I can do what I have mentioned in my post above.
Yes sounds like a working solution

Re: No Nonsense Forex - Indicators

Posted: Fri Oct 28, 2022 6:23 pm
by Daim2574
mrtools wrote: Sun Oct 23, 2022 12:44 pm Added all the prices, to the version you posted.
Dear mrtools… Could you please color the upper and lower bands based on slope similar to what you are doing for the middle line… thanks a lot

Re: No Nonsense Forex - Indicators

Posted: Sun Oct 30, 2022 4:08 am
by Daim2574
mrtools wrote: Sun Oct 23, 2022 12:44 pm Added all the prices, to the version you posted.
Just a gentle reminder… thanks again

Dear mrtools… Could you please color the upper and lower bands based on slope similar to what you are doing for the middle line… thanks a lot

Re: No Nonsense Forex - Indicators

Posted: Sun Oct 30, 2022 5:01 am
by mrtools
Daim2574 wrote: Sun Oct 30, 2022 4:08 am Just a gentle reminder… thanks again

Dear mrtools… Could you please color the upper and lower bands based on slope similar to what you are doing for the middle line… thanks a lot
Hi Daim2574,

This is mainly Centaur's thread and really don't want to get in the way of the excellent work he is doing in here.

Re: No Nonsense Forex - Indicators

Posted: Mon Oct 31, 2022 12:41 am
by Daim2574
mrtools wrote: Sun Oct 30, 2022 5:01 am Hi Daim2574,

This is mainly Centaur's thread and really don't want to get in the way of the excellent work he is doing in here.
No worries… thanks anyway mrtools 👍🏻

Re: No Nonsense Forex - Indicators

Posted: Thu Nov 03, 2022 5:23 am
by asbestosman21

Re: No Nonsense Forex - Indicators

Posted: Thu Nov 03, 2022 11:57 pm
by Centaur
Donchian Trend Ribbon
Converted tradingview indicator: https://www.tradingview.com/script/PxLq ... nd-Ribbon/

Re: No Nonsense Forex - Indicators

Posted: Fri Nov 04, 2022 12:33 am
by Centaur
Centaur wrote: Thu Nov 03, 2022 11:57 pm Donchian Trend Ribbon
Converted tradingview indicator: https://www.tradingview.com/script/PxLq ... nd-Ribbon/
Very crude coding, will look at a more compact coding method. Best settings I think is 10, all dependent on your system.

Re: No Nonsense Forex - Indicators

Posted: Fri Nov 04, 2022 1:07 am
by xpf2003
Centaur wrote: Thu Nov 03, 2022 11:57 pm Donchian Trend Ribbon
Converted tradingview indicator: https://www.tradingview.com/script/PxLq ... nd-Ribbon/
How do you use this indicator?