BSTrend

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

BSTrend

Postby Apprentice » Sat Dec 01, 2018 9:09 am

EURUSD D1 (04-02-2018 0355).png

Based on post.
https://www.prorealcode.com/prorealtime ... s/bstrend/
BSTrend.lua
(3.71 KiB) Downloaded 43 times

BSTrend.lua based strategy.
viewtopic.php?f=31&t=67041
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 20089
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: BSTrend

Postby Daveatt » Mon Dec 03, 2018 5:34 am

Hi Apprentice

This is a great indicator
Could you please develop a strategy for it ?

Thanks in advance
David
Daveatt
 
Posts: 35
Joined: Mon Jan 30, 2017 10:00 am


Re: BSTrend

Postby Daveatt » Mon Dec 03, 2018 6:50 am

Confirming it's working fine

Thanks so much

PS: I asked your help because my solution wasn't working
I creating an external stream in the BStrend indicator and tried to access it via the strategy

In the indicator

Code: Select all
function Prepare(name)
...
 BST_Stream = instance:addStream("BST_Stream" , core.Bar, " BST_Stream"," BST_Stream",Neutral, first);

...

function Update(period)
..
 if ((ld8 < 0.0 and ld0 > 0.0) or ld8 < 0.0) then
    Oscillator:setColor(period,Down);
    BST_Stream = -1;
    elseif ((ld8 > 0.0 and ld0 < 0.0) or ld8 > 0.0) then 
    Oscillator:setColor(period, Up);
    BST_Stream = 1;
    else
    Oscillator:setColor(period,Neutral);
    BST_Stream = 0;
    end
..
end


In the strategy

Code: Select all
function Update(period)
  if   BST.BST_Stream[period] == 1
   then
      BUY();
   elseif   BST.BST_Stream[period] == -1
   then 
      SELL();
   else
      T1_BST_Trend = "";
   end
end


Anyway your solution is working so I'm happy with it. I'll remember that if I can't access a data stream from a strategy for some reason, that I can always access the colors

Best
Daveatt
Daveatt
 
Posts: 35
Joined: Mon Jan 30, 2017 10:00 am


Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot] and 12 guests