• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 5:08am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:08am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Strategy tester queries 1 reply

Coding iCustom and Laguerre 2 replies

iCustom with PerkyAscTrend and Heiken Ashi MA 3 replies

Problem with iCustom and T_S_R Signal Line 1 reply

Metatrader Queries 6 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 3
Attachments: iCustom and Time (2 unrelated queries)
Exit Attachments

iCustom and Time (2 unrelated queries)

  • Post #1
  • Quote
  • First Post: Sep 21, 2008 4:23am Sep 21, 2008 4:23am
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
ASSISTANCE FOR EITHER ONE WOULD BE GREATLY APPRECIATED

iCustom Query

I have an Ultra Trend indicator here that I would like to get the values out of so I can program my other custom indicator (has been posted a buncha times, can again if ya want) to let the Ultra Trend filter it. I have a rather messy UT_FAST (It is Ultra Trend) one that I nicked from the x50 thread and an Ultra Trend RSI filtered one that came from a different forum, can't remember off the top of my head. If it makes it easier the cleaner one is the RSI if you know how to just remove the RSI filter and take it from there then perhaps it's easier.

If anyone could please just point me in the right direction as I don't even know what line gives the values required or how exactly iCustom works. A working example would be brilliant. I might even have the wrong idea entirely about it.


Day Query

I'm wanting to tell my indicator to not throw signals up for sunday bars (this is more for manual backtesting) or basically until the market actually opens for the week. All the session indicators are based on time and not the day, I would prefer one that can do both but haven't seen one that does yet. Even if the indicator was just a shaded box on the main chart window so I knew to quickly ignore instead of checking the date and MY time and my brokers time and the pairs market opening times. The minutes tend to add up and it drives me a tad bonkers.
Attached Files
File Type: mq4 UT_FAST.mq4   26 KB | 164 downloads
File Type: mq4 ULTRA_RSI.mq4   15 KB | 204 downloads
  • Post #2
  • Quote
  • Sep 21, 2008 4:27am Sep 21, 2008 4:27am
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
Forgot the other indicator required for the Ultra Trend RSI
Attached File
File Type: mq4 JMA_RSI.mq4   14 KB | 185 downloads
 
 
  • Post #3
  • Quote
  • Sep 21, 2008 8:16am Sep 21, 2008 8:16am
  •  trader101
  • | Commercial Member | Joined Dec 2006 | 2,911 Posts
Example

double a = iCustom(NULL,0,"UT_FAST",0,0);
double b = iCustom(NULL,0,"UT_FAST",1,0);

these are the last 2 values you see in your data windows. I dont know which of these two you need.
T101
 
 
  • Post #4
  • Quote
  • Sep 21, 2008 8:28am Sep 21, 2008 8:28am
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
Well the data values from the indicators I believe are the following

Inserted Code
SetIndexStyle(0,DRAW_LINE,0,1);
SetIndexBuffer(0,arr_global_76);
SetIndexStyle(1,DRAW_LINE,0,1);
SetIndexBuffer(1,arr_global_556);

I know how to write a valid iCustom argument, the metatrader example is fine i'm just not sure how it fetches data from the other indicator and if it has other dependencies etc.
 
 
  • Post #5
  • Quote
  • Sep 21, 2008 2:25pm Sep 21, 2008 2:25pm
  •  trader101
  • | Commercial Member | Joined Dec 2006 | 2,911 Posts
Quoting Omniferum
Disliked
Well the data values from the indicators I believe are the following

Inserted Code
SetIndexStyle(0,DRAW_LINE,0,1);
SetIndexBuffer(0,arr_global_76);
SetIndexStyle(1,DRAW_LINE,0,1);
SetIndexBuffer(1,arr_global_556);

I know how to write a valid iCustom argument, the metatrader example is fine i'm just not sure how it fetches data from the other indicator and if it has other dependencies etc.
Ignored
You have to explain well what you want to be done and also tell what you already (know) have. Try to be brief and concise. Use illustration if necessary to communicate your needs.
Thanks
 
 
  • Post #6
  • Quote
  • Sep 21, 2008 4:07pm Sep 21, 2008 4:07pm
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
I basically just want the iCustom to return the current value of a buffer so I can go "If it crosses this line or is this value or higher, check stochastic" then I have a signal.

i.e. if the green line in UT_FAST goes from below to above 8

Just need my indicator to be able to operate based on the data gotten from iCustom is all.

My previous thread regarding this was for an alarm just for UT_FAST but apparently everyone thought it was a tad too convoluted to program so I believe iCustom could sort of solve that problem.

So if I can double a = iCustom(NULL,0,"UT_FAST",0,0); and then just use

if (a<8 && a1>8)

along those lines, I assume iCustom provides values just like if you double stoch = Istochastic etc etc.

Am I wrong? Or does iCustom require a fair few more parameters that I am unaware of
 
 
  • Post #7
  • Quote
  • Sep 21, 2008 7:49pm Sep 21, 2008 7:49pm
  •  trader101
  • | Commercial Member | Joined Dec 2006 | 2,911 Posts
Quoting Omniferum
Disliked
I basically just want the iCustom to return the current value of a buffer so I can go "If it crosses this line or is this value or higher, check stochastic" then I have a signal.

i.e. if the green line in UT_FAST goes from below to above 8

Just need my indicator to be able to operate based on the data gotten from iCustom is all.

My previous thread regarding this was for an alarm just for UT_FAST but apparently everyone thought it was a tad too convoluted to program so I believe iCustom could sort of solve that problem.

So if I can double a = iCustom(NULL,0,"UT_FAST",0,0); and then just use

if (a<8 && a1>8)

along those lines, I assume iCustom provides values just like if you double stoch = Istochastic etc etc.

Am I wrong? Or does iCustom require a fair few more parameters that I am unaware of
Ignored
No you are right... The logic should conform to your requirement..
example you can say..
if (a >= 8) Buy....trade...
if (a < 8) Sell ......
This is where you are going to be careful with your logic, make sure that the program understand exactly what you want. Remeber the a in that example is taken at a 0 bar, you might have it taken at bar 1 or the just completed bar then the last zero on the custom have to be 1 instead of 0. I hope i explain it well.
T101
 
 
  • Post #8
  • Quote
  • Sep 21, 2008 11:59pm Sep 21, 2008 11:59pm
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
Well seeing as I have clarified myself can anyone please show what the iCustom argument for the UT_FAST would be?

A standard one would be what was provided earlier in this thread but it doesn't work.

Assistance pretty please?
 
 
  • Post #9
  • Quote
  • Sep 22, 2008 12:12am Sep 22, 2008 12:12am
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
Joy, figured it out.

hah, I tried the basic argument before this thread and it didn't work. Didn't work during either, however I put the code outside the i loop which is rather stupid.

So it works like a charm now.

Still needing the time thing though, does no one know of a day/time shader?
 
 
  • Post #10
  • Quote
  • Sep 22, 2008 2:01am Sep 22, 2008 2:01am
  •  trendchaser
  • | Membership Revoked | Joined Oct 2007 | 2,124 Posts
sunday is a day of the week so you can add this into any if statement
DayOfWeek()!=0
this means if the day is not sunday, continue
0=sunday
1=monday, and so on to 7

Quoting Omniferum
Disliked
ASSISTANCE FOR EITHER ONE WOULD BE GREATLY APPRECIATED

iCustom Query

I have an Ultra Trend indicator here that I would like to get the values out of so I can program my other custom indicator (has been posted a buncha times, can again if ya want) to let the Ultra Trend filter it. I have a rather messy UT_FAST (It is Ultra Trend) one that I nicked from the x50 thread and an Ultra Trend RSI filtered one that came from a different forum, can't remember off the top of my head. If it makes it easier the cleaner one is the RSI if you know how to just remove the RSI filter and take it from there then perhaps it's easier.

If anyone could please just point me in the right direction as I don't even know what line gives the values required or how exactly iCustom works. A working example would be brilliant. I might even have the wrong idea entirely about it.


Day Query

I'm wanting to tell my indicator to not throw signals up for sunday bars (this is more for manual backtesting) or basically until the market actually opens for the week. All the session indicators are based on time and not the day, I would prefer one that can do both but haven't seen one that does yet. Even if the indicator was just a shaded box on the main chart window so I knew to quickly ignore instead of checking the date and MY time and my brokers time and the pairs market opening times. The minutes tend to add up and it drives me a tad bonkers.
Ignored
 
 
  • Post #11
  • Quote
  • Sep 22, 2008 2:08am Sep 22, 2008 2:08am
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
Thing is though is that I want to discontinue more than just a day also what is sunday for some pairs may be monday for others.

Basically the sunday for the pair and the first 2 hours of the week is what I want to exclude.

post 2 hours till friday lunchtime, stuff like that

I suppose i'm asking for an elegant solution, something simple that doesn't require declaring 3 different bits of code
 
 
  • Post #12
  • Quote
  • Sep 22, 2008 2:21am Sep 22, 2008 2:21am
  •  trendchaser
  • | Membership Revoked | Joined Oct 2007 | 2,124 Posts
only way i know is to code it not to trade all the broker times you want filtered

or code it when to trade, broker time is the only way i know of
 
 
  • Post #13
  • Quote
  • Sep 22, 2008 2:24am Sep 22, 2008 2:24am
  •  Omniferum
  • | Joined Jun 2008 | Status: Member | 100 Posts
Well I would obviously declare the times in the broker equivalent (it's GMT)

is there anyway I can just state something like day of week monday (time) until day of week friday (time)?
 
 
  • Post #14
  • Quote
  • Sep 22, 2008 2:30am Sep 22, 2008 2:30am
  •  trendchaser
  • | Membership Revoked | Joined Oct 2007 | 2,124 Posts
well i think you can use your pc time, but itl be in a time format, youl endup using just as much code
id use day of week, and hour, shouldnt take much

Quoting Omniferum
Disliked
Well I would obviously declare the times in the broker equivalent (it's GMT)

is there anyway I can just state something like day of week monday (time) until day of week friday (time)?
Ignored
 
 
  • Post #15
  • Quote
  • Sep 22, 2008 2:32am Sep 22, 2008 2:32am
  •  trendchaser
  • | Membership Revoked | Joined Oct 2007 | 2,124 Posts
oh yeah sure, if day of week is >0 && hour is > whatever, and day of week is below whatever && hour is below whatever

Quoting Omniferum
Disliked
Well I would obviously declare the times in the broker equivalent (it's GMT)

is there anyway I can just state something like day of week monday (time) until day of week friday (time)?
Ignored
 
 
  • Post #16
  • Quote
  • Sep 22, 2008 2:37am Sep 22, 2008 2:37am
  •  trendchaser
  • | Membership Revoked | Joined Oct 2007 | 2,124 Posts
well youl need it in seperate lines, as hour applies to every day

bool cantrade=false;
if (DayOfWeek>0)cantrade=true;
if (DayOfWeek==1&&Hour()>?)cantrade=true;

same for friday

just play with it
 
 
  • Post #17
  • Quote
  • Last Post: Sep 22, 2008 2:40am Sep 22, 2008 2:40am
  •  trendchaser
  • | Membership Revoked | Joined Oct 2007 | 2,124 Posts
heres how i code my indies, you can do basically the same principal, i code in all the rules to trade, then i check the rules to not trade, with a single result

signal= "buy" or "sell", or "none"





//+------------------------------------------------------------------+
//| TC check_entry
//+------------------------------------------------------------------+
void check_entry()
{
signal="none";
if (t_trades>=1000){close_all();}
if (use_ha2&&hha>hha2){signal= "buy";shorts_allowed=true;}
if (use_ha2&&hha<hha2){signal= "sell";longs_allowed=true;}
if (use_ha&&ha>ha2){signal= "buy";shorts_allowed=true;}
if (use_ha&&ha<ha2){signal= "sell";longs_allowed=true;}
if (use_ma&&cl>ma){signal= "buy";shorts_allowed=true;}
if (use_ma&&cl<ma){signal= "sell";longs_allowed=true;}
if (use_ma_cross&&ma1>ma2){signal= "buy";shorts_allowed=true;}
if (use_ma_cross&&ma1<ma2){signal= "sell";longs_allowed=true;}
if (use_psar&&cl>psar){signal= "buy";shorts_allowed=true;}
if (use_psar&&cl<psar){signal= "sell";longs_allowed=true;}
if (use_psar2&&cl>psar2){signal= "buy";shorts_allowed=true;}
if (use_psar2&&cl<psar2){signal= "sell";longs_allowed=true;}
if (use_psar3&&cl>psar3){signal= "buy";shorts_allowed=true;}
if (use_psar3&&cl<psar3){signal= "sell";longs_allowed=true;}
if (use_psar4&&cl>psar4){signal= "buy";shorts_allowed=true;}
if (use_psar4&&cl<psar4){signal= "sell";longs_allowed=true;}
if (use_psar5&&cl>psar5){signal= "buy";shorts_allowed=true;}
if (use_psar5&&cl<psar5){signal= "sell";longs_allowed=true;}
if (use_psar6&&cl>psar6){signal= "buy";shorts_allowed=true;}
if (use_psar6&&cl<psar6){signal= "sell";longs_allowed=true;}
}

//+------------------------------------------------------------------+
//| TC filter_signal
//+------------------------------------------------------------------+
void filter_signal()
{
if (use_ha2&&hha>hha2&&signal=="sell"){signal="none";}
if (use_ha2&&hha<hha2&&signal=="buy"){signal="none";}
if (use_ha&&ha>ha2&&signal=="sell"){signal="none";}
if (use_ha&&ha<ha2&&signal=="buy"){signal="none";}
if (use_ma&&cl>ma&&signal=="sell"){signal="none";}
if (use_ma&&cl<ma&&signal=="buy"){signal="none";}
if (use_ma_cross&&ma1>ma2&&signal=="sell"){signal="none";}
if (use_ma_cross&&ma1<ma2&&signal=="buy"){signal="none";}
if (use_psar&&cl>psar&&signal=="sell"){signal="none";}
if (use_psar&&cl<psar&&signal=="buy"){signal="none";}
if (use_psar2&&cl>psar2&&signal=="sell"){signal="none";}
if (use_psar2&&cl<psar2&&signal=="buy"){signal="none";}
if (use_psar3&&cl>psar3&&signal=="sell"){signal="none";}
if (use_psar3&&cl<psar3&&signal=="buy"){signal="none";}
if (use_psar4&&cl>psar4&&signal=="sell"){signal="none";}
if (use_psar4&&cl<psar4&&signal=="buy"){signal="none";}
if (use_psar5&&cl>psar5&&signal=="sell"){signal="none";}
if (use_psar5&&cl<psar5&&signal=="buy"){signal="none";}
if (use_psar6&&cl>psar6&&signal=="sell"){signal="none";}
if (use_psar6&&cl<psar6&&signal=="buy"){signal="none";}
}

//+------------------------------------------------------------------+
//| TC check_exit
//+------------------------------------------------------------------+
void check_exit()
{
command="none";
if (exit_ha2&&hha>hha2){close_shorts();}
if (exit_ha2&&hha<hha2){close_longs();}
if (use_ha2_tp&&hha>hha2){close_shorts_profit();}
if (use_ha2_tp&&hha<hha2){close_longs_profit();}
if (exit_ha&&ha>ha2){close_shorts();}
if (exit_ha&&ha<ha2){close_longs();}
if (use_ha_tp&&ha>ha2){close_shorts_profit();}
if (use_ha_tp&&ha<ha2){close_longs_profit();}
if (exit_ma&&cl>ma){close_shorts();}
if (exit_ma&&cl<ma){close_longs();}
if (use_ma_tp&&cl>ma){close_shorts_profit();}
if (use_ma_tp&&cl<ma){close_longs_profit();}
if (exit_ma_cross&&ma1>ma2){close_shorts();}
if (exit_ma_cross&&ma1<ma2){close_longs();}
 
 
  • Platform Tech
  • /
  • iCustom and Time (2 unrelated queries)
  • Reply to Thread
0 traders viewing now
Top of Page
Forex Factory Blog Updated: Alerting All Members
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022