Hey fellow Quants and Programmers at Elite Trader,
Short introduction of myself: I'm a (very) new and young trader who has his origin in quantum physics, vector analysis and electronics, but has grown extremley fond of trading stocks and have got most of my TA-theory from John J. Murphy - "Technical Analysis Of The Finachial Markets".
I've been programming Java most of my life, and have just started to learn PL. I've learned to analyse a stock that is trending or somewhat to the verge of trending, but I'm having difficulties finding these from my live-feed from which I can collect +2200 stocks from different markets. I somehow need to filter out those which I find interesting.
As trading software I'm one of few in my country who has a license to Multicharts, and have been using that together with some other candlestick-pattern recognition software.
To my actual question: I need to construct some sort of filter to sort trending stocks from the non-trending stocks. To make it easy and to have some kind of start my programming logic will be the following:
1. Recognize at least 3 consecutive candlestick ups.
2. Check so RSI is under 80 to avoid extremes.
Nothing more advanced than that to begin with. If these two conditions are met, then plot a 1 otherwise plot 0. My code turned out the following:
The type of code is set as an indicator. It's not working but instead it is set as 1 all the time. I'm having a hard time understanding how return types work in PL, but it seems like this shouldn't be too hard to fix. Constructive feedback would be very apperciated, what needs to be changed in the code?
As a second question regarding my approach of finding trending stocks, would ADX & DMI work better than consecutive ups?
Kind Regards,
Tahu
Short introduction of myself: I'm a (very) new and young trader who has his origin in quantum physics, vector analysis and electronics, but has grown extremley fond of trading stocks and have got most of my TA-theory from John J. Murphy - "Technical Analysis Of The Finachial Markets".
I've been programming Java most of my life, and have just started to learn PL. I've learned to analyse a stock that is trending or somewhat to the verge of trending, but I'm having difficulties finding these from my live-feed from which I can collect +2200 stocks from different markets. I somehow need to filter out those which I find interesting.
As trading software I'm one of few in my country who has a license to Multicharts, and have been using that together with some other candlestick-pattern recognition software.
To my actual question: I need to construct some sort of filter to sort trending stocks from the non-trending stocks. To make it easy and to have some kind of start my programming logic will be the following:
1. Recognize at least 3 consecutive candlestick ups.
2. Check so RSI is under 80 to avoid extremes.
Nothing more advanced than that to begin with. If these two conditions are met, then plot a 1 otherwise plot 0. My code turned out the following:
Code:
inputs:
Price ( Close ),
ConsecutiveBarsUp ( 3 ),
Length(14);
variables:
var0(0);
var0 = RSI(Price, Length);
if Price > Price[1] then
Value1 = Value1 + 1
else
Value1 = 0;
if Value1 >= ConsecutiveBarsUp and var0 < 80 then
begin
Plot1( 1, "ConsecTrend" );
Alert;
end
else
NoPlot( 0 );
The type of code is set as an indicator. It's not working but instead it is set as 1 all the time. I'm having a hard time understanding how return types work in PL, but it seems like this shouldn't be too hard to fix. Constructive feedback would be very apperciated, what needs to be changed in the code?
As a second question regarding my approach of finding trending stocks, would ADX & DMI work better than consecutive ups?
Kind Regards,
Tahu