Simple Coding Help - No Promise.

@bbhanushali : Can you please let me know the code for price above or below open price. I am already adding this to an RSI code, and want to add this condition as well, where price is above the open or below the open price.

Can you help.

Cheers
JS
 

yusi

Well-Known Member
Not the way of the Jedi. The image is not lucid, and do not see your attempt at the code.

Here is my attempt; will leave it to you to code the Sell.

Code:
Lookback = 20;
HighLookback = HHV(Close, Lookback);
AvgVolumeLookback = MA(Volume, Lookback);

Buy1 = Close > Ref(HighLookback, -1);
Vol1 = Volume > AvgVolumeLookback;
Buy2 = Ref(Close, -1) > Ref(HighLookback, -2);
Vol2 = Ref(Volume, -1) > Ref(AvgVolumeLookback, -1);
// Some volume filter for active scrip

Buy = Buy1 AND Vol1 AND Buy2 AND Vol2;
//Sell = Sell1 AND Vol1 AND Sell2 AND Vol2;
//Buy = ExRem(Buy, Sell);
//Sell = ExRem(Sell, Buy);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
PlotShapes(Buy * shapeUpArrow, colorLime, 0, Low, -25);
 
Dear Yusi,Happysingh,BB& AFL experts..
a small help to make a code..(i dont know it's possible or not)
how to make indicator on/off switch on chart like buy/sell button...i know we can do it on parameters window,
but if it's on chart window , switch over maybe easy..

Happy Trading..
 
Not the way of the Jedi. The image is not lucid, and do not see your attempt at the code.

Here is my attempt; will leave it to you to code the Sell.

Code:
Lookback = 20;
HighLookback = HHV(Close, Lookback);
AvgVolumeLookback = MA(Volume, Lookback);

Buy1 = Close > Ref(HighLookback, -1);
Vol1 = Volume > AvgVolumeLookback;
Buy2 = Ref(Close, -1) > Ref(HighLookback, -2);
Vol2 = Ref(Volume, -1) > Ref(AvgVolumeLookback, -1);
// Some volume filter for active scrip

Buy = Buy1 AND Vol1 AND Buy2 AND Vol2;
//Sell = Sell1 AND Vol1 AND Sell2 AND Vol2;
//Buy = ExRem(Buy, Sell);
//Sell = ExRem(Sell, Buy);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
PlotShapes(Buy * shapeUpArrow, colorLime, 0, Low, -25);
Thanks so much Yusi, yeah today I seriously thought I should take my next step to learn coding... thanks for your encouragement and the code, much appreciated bro.
 

ajeetsingh

Well-Known Member
No BB it doesnt work that way. What ever TF set in the exploration, that is the same TF chart that opens up regardless of Sync on Chart being on/off.
Simplest solution I can give

Capture.JPG


Here my scan is in daily chart
I want to see in 15 minutes
Open 2 charts, 1 daily and 1 for 15 mins
link the symbols in both chart
while daily chart is active.... run scan click symbol to see on chart
then click 15 min and same symbol in lower timeframe with same selection of moment (selector line) will appear.
i dont think any other way its possible
you can try it with any time frames
Thanks
 

Similar threads