Page 1 of 1

Identify direction of price

PostPosted: Tue Mar 29, 2016 12:11 pm
by jacklrfx
Hi,
I have written a piece of code, I would like to test an idea. This indicator should check the trend, there is a NonLagMA with filt, and then check if the trade done is correct or not.

I mean NonLagMa indicates up trend (color[period-59]=color.Up and color[period-60]=color.DN) then I suppose at period 59 to open trade, and then I check if current close price is > than the price at which I have opened the trade.

So the indicator at current period checks if 59 period ago there is a sign of changing in the trend and then checks if the current price is > than the price of opening. The opposite for short trades.

I don't open trade I just want to test if the direction supposed is correct. And I have to test for every period what happened a number (choosen by you, could be any number 59, 21, 74,...) of period before the actual.
Please check also if NonLagMa is repaint, It doesn't seems to be repainted, but I don't know exactly.

I have written the indicator but there is something not working.
Please, have a check.

The indicator should display the number of trades correctly supposed, and the number of trades wrong. If it is possible display entry, exit with arrow.

Re: Identify direction of price

PostPosted: Wed Mar 30, 2016 7:46 am
by Apprentice
Based on your idea.
viewtopic.php?f=17&t=63324

Re: Identify direction of price

PostPosted: Wed Mar 30, 2016 8:06 am
by Apprentice
EURUSD m1 (03-30-2016 1432).png

I hope that I understand / preserved your intentions.
ctvt.lua
(5.74 KiB) Downloaded 359 times