Coding query. No more trades for the day
-
- Posts: 7
- Joined: 26 Sep 2014
- Has thanked: 2 times
Coding query. No more trades for the day
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.
- 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
Hello bondstrader,
Here is a a simple example of one of the mentioned conditions:
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;