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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Unknown problem with iCustom() function 1 reply

Problem with iCustom and T_S_R Signal Line 1 reply

Referencing Indicator Arrays. 4 replies

icustom() problem 5 replies

IB referencing to my account 12 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Have a problem referencing iCustom
Cancel

Have a problem referencing iCustom

  • Post #1
  • Quote
  • First Post: May 23, 2011 10:06pm May 23, 2011 10:06pm
  •  T.Trade
  • | Joined May 2010 | Status: Member | 57 Posts
Hi There

I have used several generic EA templates and tried referencing iCustom, but the EA doesn't trade even though it compiles ok and the indicator itself generates "trade signals".
I think I'm referencing iCustom incorrectly. Inputs are appreciated.

I'm trying to reference two values from the indicator Complex_Pairs1.
One is the signalline (SetIndexBuffer 0), the other one is the moving average of the signalline (SetIndexBuffer 1).

The indicator has two external parameters:
SignalType (for type of signal in case of an indicator crossover)
periodSMA (the period of the simple moving average)
I have pasted the relevant part of the sourcecode below.

Using iCustom I try to access 4 different values - the signalline and the SMA at bar 1 and bar 2, and I'm using this code:

double SignallineShift1 = iCustom(NULL,NULL,"Complex_Pairs1",2,0,0,1);
double SmaShift1 = iCustom(NULL,NULL,"Complex_Pairs1",2,4,1,1);
double SignallineShift2 = iCustom(NULL,NULL,"Complex_Pairs1",2,0,0,2);
double SmaShift2 = iCustom(NULL,NULL,"Complex_Pairs1",2,4,1,2);

Am I referencing the indicator values correctly? iCustom(symbol, timeframe, indicator name, SignalType, periodSMA, IndexBuffer, Shift). Or should I maybe omit signaltype and periodsma for the signal line, and signalType for the SMA?

Cheers
Tomas

___________________________________________________

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_width2 1
//---- buffers
double pair[],ma[];
//----
extern int SignalType=2;
extern int periodSMA=4;

SetIndexStyle(0, DRAW_LINE);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(0, pair);
SetIndexBuffer(1, ma);
  • Post #2
  • Quote
  • May 23, 2011 10:13pm May 23, 2011 10:13pm
  •  Venice
  • Joined Jul 2010 | Status: Weebley Wobbly Timey Wimey stuff | 10,604 Posts
Quoting T.Trade
Disliked
Hi There

I have used several generic EA templates and tried referencing iCustom, but the EA doesn't trade even though it compiles ok and the indicator itself generates "trade signals".
I think I'm referencing iCustom incorrectly. Inputs are appreciated.

I'm trying to reference two values from the indicator Complex_Pairs1.
One is the signalline (SetIndexBuffer 0), the other one is the moving average of the signalline (SetIndexBuffer 1).

The indicator has two external parameters:
SignalType (for type of signal in case of an indicator crossover)
periodSMA...
Ignored
iCustom's 2nd parameter takes a numeric value for the timeframe, not a null value. You need to use 0 for the current timeframe.

Try this:

Quote
Disliked
double SignallineShift1 = iCustom(NULL,0,"Complex_Pairs1",2,0,0,1);
double SmaShift1 = iCustom(NULL,0,"Complex_Pairs1",2,4,1,1);
double SignallineShift2 = iCustom(NULL,0,"Complex_Pairs1",2,0,0,2);
double SmaShift2 = iCustom(NULL,0,"Complex_Pairs1",2,4,1,2);
One thing I try doing is using the Comment() method to display current values on the screen for debugging purposes, as well as using the Print() method to send these values to the journal.
 
 
  • Post #3
  • Quote
  • May 24, 2011 1:42am May 24, 2011 1:42am
  •  T.Trade
  • | Joined May 2010 | Status: Member | 57 Posts
Thanks Venice! I'll try it all an see if it works.
 
 
  • Post #4
  • Quote
  • Last Post: May 24, 2011 5:32am May 24, 2011 5:32am
  •  T.Trade
  • | Joined May 2010 | Status: Member | 57 Posts
Hello again

Got it working now, however the reference to iCustom wasn't the only problem.
I tried it in Ronald Rayguns Generic MA Crossover EA where it used the indicator instead of moving averages. It turns out, that I'm using a broker which requires a modification of the open order to place stoploss and profittarget afterwards. This might have been an issue when I tried it the first time.

Now I have to do some work figuring out howcome it only places short trades. And it's not one of the two most common errors (error in OpenBuy code or that the EA setting is only for short trades) Well, well...
Thanks a lot for Your help anyways.
 
 
  • Platform Tech
  • /
  • Have a problem referencing iCustom
  • Reply to Thread
0 traders viewing now
Top of Page
  • 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 / ©2023