Buy / Sell Code

Questions about MultiCharts and user contributed studies.
Posts: 15
Joined: 12 Apr 2016
Has thanked: 1 time

Buy / Sell Code

Postby rreyes22 » 14 Mar 2018

I am in need of some assistance with my “Buy” Sell” code for my Signal (automated trading strategy). I want my Buy / Sell code to buy the next bar at the opening tick. Everything I try Buys or Sells the next bar, but all up and down the bar and with no consistency. I have checked the “Intra Bar Order Generation” (IBOG) box, but unfortunately this does not help. Under the IBOG box are three (3) Entry and three (3) Exit choices, I have tried a combination of all three and no help. I have tried the codes for Buy listed below and they all work the same – up and down the next bar. I would greatly appreciate any and all help. There is of course initial code, in my Signal, to trigger the Buy or Sell code.

Buy next bar Open ;
Buy next bar Market ;
Buy next bar Open stop ;
Buy next bar Open limit ;
Buy next bar Open[1] stop ;
Buy next bar Open[0] stop ;
Buy next bar Open tomorrow ; … IBOG is unchecked

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 136 times

Re: Buy / Sell Code

Postby Anna MultiCharts » 14 Mar 2018

Hello, rreyes22!

Without IOG orders in MultiCharts are generated on the bar close and are sent to the broker on the next bar open.
“Next bar” command depends on the IOG setting: if IOG is ON, it will generate the order on the next tick, if IOG is OFF, the order will be generated on the bar close and sent on the new bar opening when the opening tick come for it. So if you need your orders to be only sent on the new bar opening, then avoid using IOG.
Please also refer to this article to find how the signals are calculated on history and in realtime: ... Calculated

Please keep in mind that if by “I want my Buy / Sell code to buy the next bar at the opening tick” you mean that you want your order to be executed at the Open price, then this is not something that you can control from MultiCharts and your AT strategy as only brokers are accountable for order execution. So if your order gets executed at the same price as the bar Open price, then you are just lucky to get that price available at the broker.

Return to “MultiCharts”