Dos not work > [IntrabarOrderGeneration = true]

Questions about MultiCharts and user contributed studies.
User avatar
Mark Brown
Posts: 182
Joined: 29 Nov 2016
Has thanked: 114 times
Been thanked: 18 times

Dos not work > [IntrabarOrderGeneration = true]

Postby Mark Brown » 30 Dec 2022

As you can see the system will only execute the trade on the close

YET the same code will place an arrow where the code tells it.

The Blue and Red arrows the system - the Pink arrows are a text tool placed by the same code.

This means that SOMETHING IS WRONG


[IntrabarOrderGeneration = true]

var:intrabarpersist dnband2(0),intrabarpersist upband2(0);


dnband2= {the lowest lower band "outside lowest"}
upband2= {the highest high band "outside highest"}

if c<=dnband2 and c[1]>=dnband2 then begin sell short next bar market;

// code above will only sell on close of the bar no matter how you code it.

//yet code below will put arrow where instructed by the code above


value1=Arw_New_s(Date, Time_s,dnband2, true); //plots the sell arrow at the sell stop price
arw_setsize(value1,0);
arw_setstyle(value1,3);
arw_setcolor(value1,pink);
end;

if c>=upband2 and c[1]<=upband2 then begin buy next bar market;

//code above will on buy on close of bar no matter how you code it.

//yet code below will put arrow where instructed by the code above


value1=Arw_New_s(Date, Time_s,upband2, false); //plots the sell arrow at the sell stop price
arw_setsize(value1,0);
arw_setstyle(value1,3);
arw_setcolor(value1,pink);




https://imagizer.imageshack.com/img924/8546/YX20zP.png < LARGER IMAGE
Image


Please stop telling us it works - look into it

All I want is to buy where I tell it and sell where I tell it - why is that impossible?

User avatar
Kate MultiCharts
Posts: 593
Joined: 21 Oct 2020
Has thanked: 9 times
Been thanked: 148 times

Re: Dos not work > [IntrabarOrderGeneration = true]

Postby Kate MultiCharts » 09 Jan 2023

Hello Mark,

We replied to this under your post at the Project Management here.

That’s expected behaviour for your script if those are backtesting results on your screenshot. Please see how signals are calculated depending on the environment here.
The pink arrows are plotted by your script without the RecoverDrawings = false, so their values might change with new ticks and not correspond to the variable’s first value.
When calculated on real-time data, your signal sends orders within a bar and corresponds to the arrow drawing. Please see the screenshot here.
The full script used for testing is here.


Return to “MultiCharts”