- ago
Hi,
when i put your ichimou indicator into code, the cloud color is different. Furthermore, there is no margin to the right side anymore.

Is it possible to adjust these two things in code?

Thx
0
222
Solved
5 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.33% )
- ago
#1
No, Strategies operate only on the actual data, and can't work with blank bars added to the end of the history. As far as the colors go, how are you plotting them in code? Can you show us?
0
- ago
#2
Edit: Sorry wanted to add the pic to first post already

I just used the 'Push dropped indicators...' command.

The automatic generated code is the following:

CODE:
public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          ind5 = new ChikouSpan(bars,26);          PlotIndicator(ind5, WLColor.FromArgb(255,72,61,139), PlotStyle.Line);          ind4 = new SenkouSpanB(bars,52,26);          PlotIndicator(ind4, WLColor.FromArgb(255,139,0,0), PlotStyle.Cloud);          ind3 = new TenkanSen(bars,9);          PlotIndicator(ind3, WLColor.FromArgb(255,0,0,255), PlotStyle.Line);          ind2 = new KijunSen(bars,26);          PlotIndicator(ind2, WLColor.FromArgb(255,255,0,0), PlotStyle.Line);          ind1 = new SenkouSpanA(bars,9,26,26);          PlotIndicator(ind1, WLColor.FromArgb(255,0,100,0), PlotStyle.Cloud); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below       private IndicatorBase ind1;       private IndicatorBase ind2;       private IndicatorBase ind3;       private IndicatorBase ind4;       private IndicatorBase ind5; }
0
Glitch8
 ( 12.33% )
- ago
#3
You can change those color parameters to specify any colors you like.

You can use the format shown here, WLColor.FromArgb(a, r, g, b) where (a)lpha, (r)ed, (g)reen and (b)lue range from 0 to 255.

Or you can use the constants like WLColor.Green or WLColor.Blue.

WLColor is fully documented in the QuickRef.
0
- ago
#4
Thank you. But I know how colors work in principial. I meant the color of the cloud. it is somehow redish. an upward cloud is usually green (and i did not post the pic again, now it comes):



the first chart is your original indicator w/o code and nice green-colored cloud. when i push it into code, the cloud has another color which kind of gives the wrong impression. would not be too bad, if one could changes that in the code, but at least as far as i can see, one just adjusts the colors of the line but not the one of the cloud. hope that makes it clearer
0
Glitch8
 ( 12.33% )
- ago
#5
You can get a similar effect by using PlotIndicatorCloud, like shown below:

CODE:
//create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          //ind5 = new ChikouSpan(bars,26);          //PlotIndicator(ind5, WLColor.FromArgb(255,132,121,199), PlotStyle.Line);          ind4 = new SenkouSpanB(bars,52,26);          //PlotIndicator(ind4, WLColor.FromArgb(255,219,80,80), PlotStyle.Cloud);          //ind3 = new TenkanSen(bars,9);          //PlotIndicator(ind3, WLColor.FromArgb(255,120,120,255), PlotStyle.Line);          //ind2 = new KijunSen(bars,26);          //PlotIndicator(ind2, WLColor.FromArgb(255,255,40,40), PlotStyle.Line);          ind1 = new SenkouSpanA(bars,9,26,26);          //PlotIndicator(ind1, WLColor.FromArgb(255,60,160,60), PlotStyle.Cloud);          PlotIndicatorCloud(ind4, ind1, WLColor.Red, WLColor.Green, 2, LineStyle.Solid, 25); }


0
Best Answer

Reply

Bookmark

Sort