[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 617

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
Can you please tell me how to declare an indicator superimposed on another indicator (e.g. MA on RSI) in an EA?
Can you please tell me how to know the lot of the last closed position? For example: the last position closed with a takeaway and we want to increase the lot of the next position.
Thank you very much, but it is not clear why the brackets are oht-1 and not oht.
the first element of the array has the number 0, the last one has the size-1
the first element of the array has the number 0, the last size-1
only calculate explicitly, e.g. using iMAOnArray() or my own algorithm.
Thank you, I will give it a try.
I have tried a different approach. I created a simple custom MA indicator from RSI. Now I need to formulate conditions for Expert Advisor to open positions by it.
For example:
if (RedLine1>BlueLine1&&RedLine2<BluLine2) OP_BUY
if (RedLine1<BlueLine1&&RedLine2>BluLine2) OP_SELL
But I don't know how to declare them. That is:
double RedLine1 = iCustom(Symbol(), 0, "MARSI", ?, ?, ......, 1);
Could you please look at it. Or someone please take a look at it.
iHigh(NULL, PERIOD_D1,1) - yesterday's high
iLow(NULL, PERIOD_D1,1) - yesterday's minimum
iOpen(NULL, PERIOD_D1,1) - yesterday's opening
iClose(NULL, PERIOD_D1,1) - yesterday's close
Is it possible to set iHai, iLo, iOpen, and iClose for a specific date, which can be changed in the indicator settings?
extern int data = 08/03/2011
iOpen(NULL, 08/03/2011,1) - what is the opening?
Thank you, I will give it a try.
I tried a different approach. I created a simple custom MA indicator from RSI. Now I need to formulate conditions for Expert Advisor to open positions with it.
For example:
if (RedLine1>BlueLine1&&RedLine2<BluLine2) OP_BUY
if (RedLine1<BlueLine1&&RedLine2>BluLine2) OP_SELL
But I don't know how to declare them. That is:
double RedLine1 = iCustom(Symbol(), 0, "MARSI", ?, ?, ......, 1);
I wonder if you could have a look at it. Or someone please take a look at it.
In your case there are no external parameters, so you don't need to write anything instead of questions:
double RedLine1 = iCustom(0, 0, "MARSI", line index, bar number);
More specifically,
double RedLine1 = iCustom(0, 0, "MARSI", 0, 1); - red at 1 bar
double RedLine2 = iCustom(0, 0, "MARSI", 0, 2); - red on 2 bar
double BlueLine1 = iCustom(0, 0, "MARSI", 1, 1); - blue on 1 bar
double BlueLine2 = iCustom(0, 0, "MARSI", 1, 2); - Blue on bar 2In your case there are no external parameters, so you don't need to write anything instead of questions:
double RedLine1 = iCustom(0, 0, "MARSI", line index, bar number);
Be more specific,
double RedLine1 = iCustom(0, 0, "MARSI", 0, 1); - red at 1 bar
double RedLine2 = iCustom(0, 0, "MARSI", 0, 2); - red on 2 bar
double BlueLine1 = iCustom(0, 0, "MARSI", 1, 1); - blue on 1 bar
double BlueLine2 = iCustom(0, 0, "MARSI", 1, 2); - Blue on bar 2