Problems checking for open trade - page 8

 
dazamate:
The only problem is I was using the ibarshift fucntion before and for some reason it was outputting 1000+
Next time you are testing that part of the code put it in as a print() statement along with pendinglimit and see if you get the right values.
 
dazamate:

Also raptor I need to pick your brain.... again :)


Is there a way to turn a moving average value into degrees? I am just googling now to see if I can find any maths forumlas. That way it would be easy for sideways market detection and clear up and down trends

Degrees are like %ages, but instead of a number out of 100 they are a number out of 360 . . . in other words a ratio/fraction. Not quite sure how you will turn a MA into a ratio/fraction ? you would need to relate your MA to something else to get the ratio/fraction. Maybe you want to relate the current MA value to the historical range (or max/min values) of the MA ?
 

If only somehow you could make a theoretical triangle from the candles and the ma and use trigonometry...


http://clip2net.com/s/14jc7

 
dazamate:

If only somehow you could make a theoretical triangle from the candles and the ma and use trigonometry...


http://clip2net.com/s/14jc7

Ah I see, you want the slope/gradient of the MA ? That's pretty easy to do . . . the problem you have is that the length on the X axis is time and the Y axis is price so the gradient is an arbitrary figure . . . what I guess you would actually be looking at is the MA velocity. You can't do anything meaningful with Trig because the angle changes as you zoom in/out, adjust the TF or the price scale . . . from what I remember Gann suffers from some of these issues . . . maybe there is a way around it, I'm not sure . . . I prefer the sound of MA Velocity ;-)

I don't use Technical Indicators, never have, never will . . . so my knowledge on them is very limited.

 

I don't use indicators either only ma's . But what I am thinking of doing is getting the ma value from the previous bar then the ma value from 6 bars before that and


MA[1]-MA[7] then getting the backtester to compare numbers against this value on the optimizer and find a suitible 'range' which can determine decent up or down movement. Does that make sense?

 
dazamate:

I don't use indicators either only ma's . But what I am thinking of doing is getting the ma value from the previous bar then the ma value from 6 bars before that and


MA[1]-MA[7] then getting the backtester to compare numbers against this value on the optimizer and find a suitible 'range' which can determine decent up or down movement. Does that make sense?

Yep, divide that value by the number of hours and you will have the MA velocity . . but you don't need to.
Reason: