Market Orders w/ BarMagnifier and IOG on Range Bars Question  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
MarketPrep
Posts: 9
Joined: 24 Apr 2013
Has thanked: 2 times

Market Orders w/ BarMagnifier and IOG on Range Bars Question

Postby MarketPrep » 08 Aug 2013

I cannot get Market Orders w/ BarMagnifier (ON) and IOG (ON) on Range Bars to execute on the current bar before the bar close. Is this possible in 8.5 .Net ?

I am trying to execute a sellshort market order when I get above a certain value in an existing Range Bar. As I understand the wiki and C# guide CalcBar will be called for every N Ticks specified within BarMagnifier in this case every 1 tick. However I cannot ever get the entry to occur anytime other than at the close of the bar.

I can get this to work with a IOrderPrice Stop order but I would prefer to use a Market Order Instead.

I cannot find this question elsewhere and I cannot find the information on the wiki. Please Advise?

General Gist of Code

Code: Select all

private IOrderMarket sell_order;
protected override void Create(){
ConsecBarsDn_Cnt = new VariableObject<int>(this);
sell_order = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, "SE", EOrderAction.SellShort));
}

protected override void StartCalc(){
}

protected override void CalcBar(){
double TestHigh;
double TestLow;
double TestInternalHigh;
double TestInternalLow;
double RealRange;
...
if (Bars.CloseValue > TestInternalHigh && Bars.CloseValue < TestHigh ){
sell_order.Send();
}
}
https://www.multicharts.com/trading-sof ... hart_Types

User avatar
Alex MultiCharts
Posts: 194
Joined: 09 Aug 2013
Has thanked: 43 times
Been thanked: 76 times

Re: Market Orders w/ BarMagnifier and IOG on Range Bars Ques  [SOLVED]

Postby Alex MultiCharts » 12 Aug 2013

Please find the script sample in the attached file.
Attachments
Test_MarketInIOGAndBM.pln
(1.9 KiB) Downloaded 368 times


Return to “MultiCharts .NET”