How to code? - page 61

 

Thanks Wolfe,

Yes I have seen that this is possible. That is not really my problem. One way to illustrate the problem is to try to use a library function as that is in manner that I am used to program. But in a library routine I dont seem to have access to things like Close. Does that mean that I have to pass arrays for open, high, low and close fro the number of bars I need to the library routine? Seems a bit awkward since "everything" is available in a Indicator type of routine. So should I write 5 different indicator routines and call them from the EA routine? In that case can I just skip the screen writing in the Indicator routine and just return a value to the EA routine instead. Or do i have to return an array of values that match all the bars?

Struggling along

Ingvar

 
ingvar_e:
Thanks Wolfe,

Yes I have seen that this is possible. That is not really my problem. One way to illustrate the problem is to try to use a library function as that is in manner that I am used to program. But in a library routine I dont seem to have access to things like Close. Does that mean that I have to pass arrays for open, high, low and close fro the number of bars I need to the library routine? Seems a bit awkward since "everything" is available in a Indicator type of routine. So should I write 5 different indicator routines and call them from the EA routine? In that case can I just skip the screen writing in the Indicator routine and just return a value to the EA routine instead. Or do i have to return an array of values that match all the bars?

Struggling along

Ingvar

If you are just looking for the close of certain bars, and not the MA value of a certain bar, you could use the Close[] series array. I'm not sure if this will help you or not.

To call the close of current bar use Close[0]

To call the close of of 5 bars ago use Close[5]

Again, I'm not sure if this is helping you or not. You probably already know this. From reading your posts you seem to have more programming experience than me.

Hope this helps somehow.

 

Hi Wolfe,

Yes, I know about the CLose. The problem is that this array is not readily available in a library routine it seems. When programming I like to strukture all code in functional "pieces" and ideally one "piece" should not exceed one page in length.

Happy New Year

Ingvar

 

Anybody here can help me?...

Hello guys...

What i want is..I plan to use 3 indicator...when 3 indicator signal buy and ea make a BUY post then after Target Point, i dont want ea make a buy post again and ea waiting until indicator give signal SELL.Like BUY,SELL,BUY,SELL,BUY,SELL and forever.I don care if in one day the indicator give signal for BUY or for SELL only.

Thanks to who can help me.

 

sell,buy,sell,buy.....

hi..

i want to add a code to my expert that let expert close sell or buy position when certaine pips reached"say 50 pips"... then look only for opposite position of first closed position " if first closed position was sell, look for buy to close"...third position closed will be opposite for 2nd closed position....

report of account will be :

sell

buy

sell

buy

sll

buy

is this possible to be coded?

 

use "comment(all you variables,v2,v3,v4...)" to preview all variables you have in the expert

and run a visual test ... and keep your eye in the upper left corner specially when long signal is expected

 

Two indicators: from two in 1 window to 2 in 2 windows with different values...

Imagine you put two seperate (custom) indicators in the same seperate chart window on a chart in your terminal. They seem to correspond, cross over or whatever: they do have approximately the same values if you look at the graph, but when you place those two custom indicators in two other seperate chart windows, they turn out to have different values.

This looks like a pretty common problem to me, but I haven't found the answer on making those two indicators range between the same set of numbers (more or less) without changing the shape of the indicator. Please help.

 
 

Function for programmed scrolling of windows

I use MTF stochastic for trading.

When I manually backtest some ideas I have open more windows with various TF where I check actual status of indicators. My idea is to put vertical line on actual time in main TF windows and using global variables and joined "move" indicator on other TF windows for automatic scroll that I can see actual situation without manual scrolling every TF window.

But - I cannot find any function that allows me to scroll windows to defined position (shift). Have anybody an idea how to do it? thx in advn

 

A code

How can I code this?

If the market touches (X.XX50 or X.XX00)

then buy. How to identify last two numbers?

thanks.