Coding query. No more trades for the day

Questions about MultiCharts and user contributed studies.
bondstrader
Posts: 7
Joined: 26 Sep 2014
Has thanked: 2 times

Coding query. No more trades for the day

Postby bondstrader » 10 Nov 2014

What would be the best way to stop MC from making any further trades for the day once certain conditions are fulfilled? eg, if a stop is hit, or if equity reaches a certain level, or if certain number of trades are reached for the day.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Coding query. No more trades for the day

Postby Andrew MultiCharts » 10 Nov 2014

Hello bondstrader,

Here is a a simple example of one of the mentioned conditions:

Code: Select all

Vars: MarketPositionVariable(0), Enough(false) ;

MarketPositionVariable = MarketPosition;

If MarketPosition = 0 and MarketPosition <> MarketPositionVariable then Enough = True;

If condition1 = true and Enough = false then buy next bar market;


Return to “MultiCharts”